From: David Hildenbrand <david@redhat.com>
To: qiang.zhang@windriver.com, vbabka@suse.cz,
akpm@linux-foundation.org, sfr@canb.auug.org.au
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm, slub: add cpus_read_lock/unlock() for slab_mem_going_offline_callback()
Date: Mon, 16 Aug 2021 10:04:13 +0200 [thread overview]
Message-ID: <ef944ea5-c3cb-24e5-1ff8-b8e1008fa6ed@redhat.com> (raw)
In-Reply-To: <20210816074605.30336-1-qiang.zhang@windriver.com>
On 16.08.21 09:46, qiang.zhang@windriver.com wrote:
> From: "Qiang.Zhang" <qiang.zhang@windriver.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@windriver.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().
How does this even work or against which branch is this?
--
Thanks,
David / dhildenb
next prev parent reply other threads:[~2021-08-16 8:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-16 7:46 qiang.zhang
2021-08-16 8:04 ` David Hildenbrand [this message]
2021-08-16 8:10 ` Zhang, Qiang
2021-08-16 8:17 ` Stephen Rothwell
2021-08-16 8:23 ` David Hildenbrand
2021-08-17 7:57 ` Vlastimil Babka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ef944ea5-c3cb-24e5-1ff8-b8e1008fa6ed@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=qiang.zhang@windriver.com \
--cc=sfr@canb.auug.org.au \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox