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] [day] [month] [year] [list]
Message-ID: <ZXBbgv6is4JdfXs3@arm.com>
Date:   Wed, 6 Dec 2023 11:31:14 +0000
From:   Catalin Marinas <catalin.marinas@....com>
To:     Waiman Long <longman@...hat.com>
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] kmemleak: Avoid RCU stalls when freeing metadata for
 per-CPU pointers

On Fri, Dec 01, 2023 at 05:22:26PM -0500, Waiman Long wrote:
> On 12/1/23 14:08, Catalin Marinas wrote:
> > diff --git a/mm/kmemleak.c b/mm/kmemleak.c
> > index 1eacca03bedd..eb6cdc3e9af2 100644
> > --- a/mm/kmemleak.c
> > +++ b/mm/kmemleak.c
> > @@ -14,17 +14,15 @@
> >    * The following locks and mutexes are used by kmemleak:
> >    *
> >    * - kmemleak_lock (raw_spinlock_t): protects the object_list as well as
> > - *   del_state modifications and accesses to the object_tree_root (or
> > - *   object_phys_tree_root). The object_list is the main list holding the
> > - *   metadata (struct kmemleak_object) for the allocated memory blocks.
> > - *   The object_tree_root and object_phys_tree_root are red
> > - *   black trees used to look-up metadata based on a pointer to the
> > - *   corresponding memory block. The object_phys_tree_root is for objects
> > - *   allocated with physical address. The kmemleak_object structures are
> > - *   added to the object_list and object_tree_root (or object_phys_tree_root)
> > - *   in the create_object() function called from the kmemleak_alloc() (or
> > - *   kmemleak_alloc_phys()) callback and removed in delete_object() called from
> > - *   the kmemleak_free() callback
> > + *   del_state modifications and accesses to the object trees
> > + *   (object_tree_root, object_phys_tree_root, object_percpu_tree_root). The
> > + *   object_list is the main list holding the metadata (struct
> > + *   kmemleak_object) for the allocated memory blocks. The object trees are
> > + *   red black trees used to look-up metadata based on a pointer to the
> > + *   corresponding memory block. The kmemleak_object structures are added to
> > + *   the object_list and the object tree root in the create_object() function
> > + *   called from the kmemleak_alloc() (or kmemleak_alloc_phys()) callback and
> > + *   removed in delete_object() called from the kmemleak_free() callback
> 
> Just a minor nit. For completeness, should we mention
> kmemleak_alloc_percpu() and kmemleak_free_percpu() here?

Yeah, I was too lazy. I added some shell-style patterns and repost a v2.

> Anyway, I won't mind if you want to keep it as it is.
> 
> Reviewed-by: Waiman Long <longman@...hat.com>

Thanks.

-- 
Catalin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ