lkml.org 
[lkml]   [2022]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/3] mm, page_owner: Add page_owner_stacks file to print out only stacks and their counter
On Mon, Sep 05, 2022 at 02:57PM +0200, Marco Elver wrote:
[...]
> > +{
> > + int i = *pos, ret = 0;
> > + struct stack_record **stacks, *stack;
> > + static struct stack_record *last = NULL;
> > + unsigned long stack_table_entries = stack_hash_mask + 1;
> > +
> > + /* Continue from the last stack if we have one */
> > + if (last) {
> > + stack = last->next;
>
> This is dead code?

Oof, I just noticed that 'last' is static. Please avoid that, because
it'll make this interface really tricky to use safely. I still don't
quite understand why it needs to do this, and a kernel-doc comment would
make this clearer.

\
 
 \ /
  Last update: 2022-09-05 15:02    [W:0.097 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site