From: "Zhang, Qiang" <Qiang.Zhang@windriver.com>
To: David Rientjes <rientjes@google.com>
Cc: "cl@linux.com" <cl@linux.com>,
"penberg@kernel.org" <penberg@kernel.org>,
"iamjoonsoo.kim@lge.com" <iamjoonsoo.kim@lge.com>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: 回复: [PATCH v3] mm/slab.c: add node spinlock protect in __cache_free_alien
Date: Fri, 31 Jul 2020 08:10:43 +0000 [thread overview]
Message-ID: <BYAPR11MB26323F02BC8A654C9DD4F431FF4E0@BYAPR11MB2632.namprd11.prod.outlook.com> (raw)
In-Reply-To: <BYAPR11MB2632F9297E72A360F83A51E0FF4E0@BYAPR11MB2632.namprd11.prod.outlook.com>
________________________________________
发件人: Zhang, Qiang <Qiang.Zhang@windriver.com>
发送时间: 2020年7月31日 9:27
收件人: David Rientjes
抄送: cl@linux.com; penberg@kernel.org; iamjoonsoo.kim@lge.com; akpm@linux-foundation.org; linux-mm@kvack.org; linux-kernel@vger.kernel.org
主题: 回复: [PATCH v3] mm/slab.c: add node spinlock protect in __cache_free_alien
________________________________________
发件人: David Rientjes <rientjes@google.com>
发送时间: 2020年7月31日 7:45
收件人: Zhang, Qiang
抄送: cl@linux.com; penberg@kernel.org; iamjoonsoo.kim@lge.com; akpm@linux-foundation.org; linux-mm@kvack.org; linux-kernel@vger.kernel.org
主题: Re: [PATCH v3] mm/slab.c: add node spinlock protect in __cache_free_alien
On Thu, 30 Jul 2020, qiang.zhang@windriver.com wrote:
> From: Zhang Qiang <qiang.zhang@windriver.com>
>
> for example:
> node0
> cpu0 cpu1
> slab_dead_cpu
> >mutex_lock(&slab_mutex)
> >cpuup_canceled slab_dead_cpu
> >mask = cpumask_of_node(node) >mutex_lock(&slab_mutex)
> >n = get_node(cachep0, node0)
> >spin_lock_irq(n&->list_lock)
> >if (!cpumask_empty(mask)) == true
> >spin_unlock_irq(&n->list_lock)
> >goto free_slab
> ....
> >mutex_unlock(&slab_mutex)
>
> .... >cpuup_canceled
> >mask = cpumask_of_node(node)
> kmem_cache_free(cachep0 ) >n = get_node(cachep0, node0)
> >__cache_free_alien(cachep0 ) >spin_lock_irq(n&->list_lock)
> >n = get_node(cachep0, node0) >if (!cpumask_empty(mask)) == false
> >if (n->alien && n->alien[page_node]) >alien = n->alien
> >alien = n->alien[page_node] >n->alien = NULL
> >.... >spin_unlock_irq(&n->list_lock)
> >....
>
>As mentioned in the review of v1 of this patch, we likely want to do a fix
>for cpuup_canceled() instead.
>I see, you mean do fix in "cpuup_canceled" func?
I'm very sorry, due to cpu_down receive gobal "cpu_hotplug_lock" write lock protect. multiple cpu offline is serial,the scenario I described above does not exist.
prev parent reply other threads:[~2020-07-31 8:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-30 10:19 [PATCH v3] mm/slab.c: add node spinlock protect in __cache_free_alien qiang.zhang
2020-07-30 23:45 ` David Rientjes
2020-07-31 1:27 ` 回复: " Zhang, Qiang
2020-07-31 8:10 ` Zhang, Qiang [this message]
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=BYAPR11MB26323F02BC8A654C9DD4F431FF4E0@BYAPR11MB2632.namprd11.prod.outlook.com \
--to=qiang.zhang@windriver.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
/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;
as well as URLs for NNTP newsgroup(s).