Re: [PATCH v8 3/5] mm,page_owner: Display all stacks and their count

From: Oscar Salvador
Date: Tue Feb 13 2024 - 04:18:45 EST


On Tue, Feb 13, 2024 at 09:38:43AM +0100, Marco Elver wrote:
> On Mon, 12 Feb 2024 at 23:29, Oscar Salvador <osalvador@xxxxxxx> wrote:
> > Signed-off-by: Oscar Salvador <osalvador@xxxxxxx>
>
> Acked-by: Marco Elver <elver@xxxxxxxxxx>

Thanks!


> > + /* This pairs with smp_load_acquire() from function
>
> Comment should be
>
> /*
> *
> ...
> */

Yap, fat fingers here.

> > + if (!*ppos) {
> > + /*
> > + * This pairs with smp_store_release() from function
> > + * add_stack_record_to_list(), so we get a consistent
> > + * value of stack_list.
> > + */
> > + stack = smp_load_acquire(&stack_list);
>
> I'm not sure if it'd make your code simpler or not: there is
> <linux/llist.h> for singly-linked linked lists, although the code to
> manage the list is simple enough I'm indifferent here. Only consider
> it if it helps you make the code simpler.

I will check if it eases the code somehow.


> > +static void stack_stop(struct seq_file *m, void *v)
> > +{
> > +}
>
> Is this function even needed if it's empty? I recall there were some
> boilerplate "nop" functions that could be used.

I will check if seq already provides a dummy function for these cases.

--
Oscar Salvador
SUSE Labs