lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZcszeZ23QpYwFf-v@localhost.localdomain>
Date: Tue, 13 Feb 2024 10:16:41 +0100
From: Oscar Salvador <osalvador@...e.de>
To: Marco Elver <elver@...gle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>, linux-kernel@...r.kernel.org,
	linux-mm@...ck.org, Michal Hocko <mhocko@...e.com>,
	Vlastimil Babka <vbabka@...e.cz>,
	Andrey Konovalov <andreyknvl@...il.com>,
	Alexander Potapenko <glider@...gle.com>
Subject: Re: [PATCH v8 2/5] mm,page_owner: Implement the tracking of the
 stacks count

On Tue, Feb 13, 2024 at 09:30:25AM +0100, Marco Elver wrote:
> On Mon, 12 Feb 2024 at 23:29, Oscar Salvador <osalvador@...e.de> wrote:
> > Signed-off-by: Oscar Salvador <osalvador@...e.de>
> 
> For the code:
> 
> Reviewed-by: Marco Elver <elver@...gle.com>

Thanks!

> But see minor comments below.

> > +/**
> > + * __stack_depot_get_stack_record - Get a pointer to a stack_record struct
> > + * This function is only for internal purposes.
> 
> I think the body of the kernel doc needs to go after argument declarations.

I see. I will amend that.

> > +static void add_stack_record_to_list(struct stack_record *stack_record)
> > +{
> > +       unsigned long flags;
> > +       struct stack *stack;
> > +
> > +       stack = kmalloc(sizeof(*stack), GFP_KERNEL);
> > +       if (stack) {
> 
> It's usually more elegant to write
> 
> if (!stack)
>   return;
> 
> If the rest of the function is conditional.

Yeah, probably better to save some identation.

> > +       if (stack_record) {
> > +               /*
> > +                * New stack_record's that do not use STACK_DEPOT_FLAG_GET start
> > +                * with REFCOUNT_SATURATED to catch spurious increments of their
> > +                * refcount.
> > +                * Since we do not use STACK_DEPOT_FLAG_{GET,PUT} API, let us
> 
> I think I mentioned this in the other email, there is no
> STACK_DEPOT_FLAG_PUT, only stack_depot_put().

Yes, you did. This was an oversight.
I will fix that.


Thanks for the feedback Marco!

-- 
Oscar Salvador
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ