From: Max Krasnyansky <maxk@qualcomm.com>
To: Paul Menage <menage@google.com>
Cc: mingo@elte.hu, pj@sgi.com, linux-kernel@vger.kernel.org,
a.p.zijlstra@chello.nl
Subject: Re: [PATCH] cpuset: Make rebuild_sched_domains() usable from any context
Date: Tue, 15 Jul 2008 13:51:16 -0700 [thread overview]
Message-ID: <487D0DC4.8090103@qualcomm.com> (raw)
In-Reply-To: <6599ad830807150914h152e3716n914dfa5e28288d28@mail.gmail.com>
Paul Menage wrote:
> On Tue, Jul 15, 2008 at 4:44 AM, Max Krasnyansky <maxk@qualcomm.com> wrote:
>> From: Max Krasnyanskiy <maxk@qualcomm.com>
>>
>> I do not really like the current solution of dropping cgroup lock
>> but it shows what I have in mind in general.
>
> I think that dropping the cgroup lock will open up races for cpusets.
> The idea of a separate workqueue/thread to do the sched domain
> rebuilding is simplest.
Actually I think we do not have to make it super strict "only rebuilt
from that thread rule". I'd only off-load cpuset_write64(),
update_flag() to the thread. It'd be nice to keep hotplug path clean
synchronous. It's synchronous without cpusets so there is really no good
reason when it needs to be async without them. And the toughest part is
not even hotplug where lock nesting is pretty clear
get_online_cpus() ->
rebuild_sched_domains() ->
cgroup_lock();
// Build cpumaps
cpuset_callback_lock();
...
cpuset_callback_unlock();
cgroup_unlock();
partition_sched_domains() ->
mutex_unlock(&sched_domains_mutex);
// Rebuild sched domains
mutex_unlock(&sched_domains_mutex);
put_online_cpus()
It's the other paths where cgroup_lock() is taken by cgroups before even
calling into cpusets, like cgroup destroy case.
So I think we should just off-load those.
Max
prev parent reply other threads:[~2008-07-15 20:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-15 11:44 [PATCH] cpuset: Make rebuild_sched_domains() usable from any context Max Krasnyansky
2008-07-15 16:07 ` Paul Jackson
2008-07-15 16:11 ` Paul Menage
2008-07-15 17:19 ` Max Krasnyansky
2008-07-15 16:14 ` Paul Menage
2008-07-15 17:27 ` Max Krasnyansky
2008-07-15 20:51 ` Max Krasnyansky [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=487D0DC4.8090103@qualcomm.com \
--to=maxk@qualcomm.com \
--cc=a.p.zijlstra@chello.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=menage@google.com \
--cc=mingo@elte.hu \
--cc=pj@sgi.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