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]
Date:   Mon, 16 Aug 2021 08:10:08 +0000
From:   "Zhang, Qiang" <Qiang.Zhang@...driver.com>
To:     David Hildenbrand <david@...hat.com>,
        "vbabka@...e.cz" <vbabka@...e.cz>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
        "sfr@...b.auug.org.au" <sfr@...b.auug.org.au>
CC:     "linux-mm@...ck.org" <linux-mm@...ck.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm, slub: add cpus_read_lock/unlock() for
 slab_mem_going_offline_callback()



________________________________________
From: David Hildenbrand <david@...hat.com>
Sent: Monday, 16 August 2021 16:04
To: Zhang, Qiang; vbabka@...e.cz; akpm@...ux-foundation.org; sfr@...b.auug.org.au
Cc: linux-mm@...ck.org; linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm, slub: add cpus_read_lock/unlock() for slab_mem_going_offline_callback()

[Please note: This e-mail is from an EXTERNAL e-mail address]

On 16.08.21 09:46, qiang.zhang@...driver.com wrote:
> From: "Qiang.Zhang" <qiang.zhang@...driver.com>
>
> The flush_all_cpus_locked() should be called with cpus_read_lock/unlock(),
> ensure flush_cpu_slab() can be executed on schedule_on CPU.
>
> Fixes: 1c84f3c91640 ("mm, slub: fix memory and cpu hotplug related lock ordering issues")

>Which branch contains this commit? At least not linux.git or linux-next

> Signed-off-by: Qiang.Zhang <qiang.zhang@...driver.com>
> ---
>   mm/slub.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/mm/slub.c b/mm/slub.c
> index 5543d57cb128..cf3f93abbd3e 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -4593,12 +4593,14 @@ static int slab_mem_going_offline_callback(void *arg)
>   {
>       struct kmem_cache *s;
>
> +     cpus_read_lock();
>       mutex_lock(&slab_mutex);
>       list_for_each_entry(s, &slab_caches, list) {
>               flush_all_cpus_locked(s);
>               __kmem_cache_do_shrink(s);
>       }
>       mutex_unlock(&slab_mutex);
> +     cpus_read_unlock();
>
>       return 0;
>   }
>

>Memory notifiers are getting called from online_pages()/offline_pages(),
>where we call memory_notify(MEM_GOING_OFFLINE, &arg) under
>mem_hotplug_begin().
>
>mem_hotplug_begin() does a cpus_read_lock().

Thanks David
this is my mistake, sorry make noise.

>
>How does this even work or against which branch is this?
>
>--
>Thanks,
>
>David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ