From: Oleg Nesterov <oleg@redhat.com>
To: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Ingo Molnar <mingo@elte.hu>,
Rusty Russell <rusty@rustcorp.com.au>,
linux-kernel@vger.kernel.org, Li Zefan <lizf@cn.fujitsu.com>,
Miao Xie <miaox@cn.fujitsu.com>, Paul Menage <menage@google.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Gautham R Shenoy <ego@in.ibm.com>
Subject: Re: [PATCH] cpusets: rework guarantee_online_cpus() to fix deadlock with cpu_down()
Date: Sun, 2 Aug 2009 08:55:04 +0200 [thread overview]
Message-ID: <20090802065504.GA27164@redhat.com> (raw)
In-Reply-To: <4A74F767.7060401@cn.fujitsu.com>
On 08/02, Lai Jiangshan wrote:
>
> Oleg Nesterov wrote:
>
> >
> > - do NOT scan cs->parent cpusets. If there are no online CPUs in
> > cs->cpus_allowed, we use cpu_online_mask. This is only possible
> > when we are called by cpu_down() hooks, in that case
> > cpuset_track_online_cpus(CPU_DEAD) will fix things later.
> >
>
>
> We must scan cs->parent cpusets.
> A task is constrained by a cpuset,
Yes, the task esacpes its cpuset. With or without this patch.
Because cs->cpus_allowed has no online CPUs.
> it must be constrained
> this cpuset's parent too.
It will be constained again, after scan_for_empty_cpusets(), no?
The only difference this patch adds is that a task temporary uses
cpu_online_mask when its cs->cpuset_allowed becomes empty. Why
this is so bad? This can only happen when CPU dies and cs becomes
empty, force majeure.
Even without this patch, the task is not actually constrained by
its cs->parent. Yes, we use ->parent->cpus_allowed. But this mask
can be changed right after guarantee_online_cpus() returns. And
since this task does not belong to cs->parent cpuset,
update_tasks_cpumask() will not fix this task. Again, until
cpuset_track_online_cpus().
Could you explain what problem this patch adds?
> cpuset_lock() is not awful at all.
OK it is not awful. But surely it complicates things. And currently
it is buggy.
Oleg.
next prev parent reply other threads:[~2009-08-02 7:01 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-29 2:33 + cpu_hotplug-dont-affect-current-tasks-affinity.patch added to -mm tree Oleg Nesterov
2009-07-29 21:21 ` Oleg Nesterov
2009-07-29 21:22 ` [PATCH] cpusets: fix deadlock with cpu_down()->cpuset_lock() Oleg Nesterov
2009-07-29 23:00 ` Oleg Nesterov
2009-07-30 1:53 ` Lai Jiangshan
2009-07-30 17:51 ` Oleg Nesterov
2009-07-31 2:23 ` Lai Jiangshan
2009-08-01 4:42 ` [PATCH] cpusets: rework guarantee_online_cpus() to fix deadlock with cpu_down() Oleg Nesterov
2009-08-01 5:34 ` Oleg Nesterov
2009-08-02 2:18 ` Lai Jiangshan
2009-08-02 6:55 ` Oleg Nesterov [this message]
2009-08-04 7:35 ` Lai Jiangshan
2009-08-04 16:36 ` Oleg Nesterov
2009-07-29 21:42 ` [PATCH 0/1] cpu_hotplug: don't play with current->cpus_allowed Oleg Nesterov
2009-07-29 21:43 ` [PATCH 1/1] " Oleg Nesterov
2009-07-30 2:01 ` Lai Jiangshan
2009-07-30 16:32 ` Oleg Nesterov
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=20090802065504.GA27164@redhat.com \
--to=oleg@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=ego@in.ibm.com \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=menage@google.com \
--cc=miaox@cn.fujitsu.com \
--cc=mingo@elte.hu \
--cc=rusty@rustcorp.com.au \
/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