From: Max Krasnyansky <maxk@qualcomm.com>
To: Paul Menage <menage@google.com>
Cc: Vegard Nossum <vegard.nossum@gmail.com>,
Paul Jackson <pj@sgi.com>,
a.p.zijlstra@chello.nl, linux-kernel@vger.kernel.org,
Gautham shenoy <ego@in.ibm.com>
Subject: Re: [RFC][PATCH] CPUSets: Move most calls to rebuild_sched_domains() to the workqueue
Date: Thu, 26 Jun 2008 22:10:42 -0700 [thread overview]
Message-ID: <48647652.5050001@qualcomm.com> (raw)
In-Reply-To: <6599ad830806261417u3015a9b2i6318841de866d768@mail.gmail.com>
Paul Menage wrote:
> On Thu, Jun 26, 2008 at 1:34 PM, Paul Menage <menage@google.com> wrote:
>> void get_online_cpus(void)
>> {
>> might_sleep();
>> if (cpu_hotplug.active_writer == current)
>> return;
>> down_read(&cpu_hotplug.lock);
>> }
>>
>> void put_online_cpus(void)
>> {
>> if (cpu_hotplug.active_writer == current)
>> return;
>> up_read(&cpu_hotplug.lock);
>> }
>>
>> static void cpu_hotplug_begin(void)
>> {
>> down_write(&cpu_hotplug.lock);
>> cpu_hotplug.active_writer = current;
>> }
>>
>> static void cpu_hotplug_done(void)
>> {
>> cpu_hotplug.active_writer = NULL;
>> up_write(&cpu_hotplug.lock);
>> }
>>
>> I think that combined with moving the async rebuild_sched_domains to a
>> separate thread should solve the problem, but I'm wondering why
>> cpu_hotplug.lock was implemented this way in the first place.
>
> Oh, I guess that doesn't work because of recursive calls to
> get_online_cpus(). Maybe we need a down_read_recursive() that skips
> ahead of waiting writers if the lock is already held in read mode?
Instead of changing cpu_hotplug locking should we maybe try to avoid using
cgroup_lock in rebuild_sched_domains() ?
There is a comment in cpuset.c that says
* If a task is only holding callback_mutex, then it has read-only
* access to cpusets.
I'm not sure if it's still valid. rebuild_sched_domains() only needs read only
access, it does not really modify any cpuset structures.
Max
next prev parent reply other threads:[~2008-06-27 5:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-26 7:56 [RFC][PATCH] CPUSets: Move most calls to rebuild_sched_domains() to the workqueue Paul Menage
2008-06-26 9:34 ` Vegard Nossum
2008-06-26 9:50 ` Paul Menage
2008-06-26 18:49 ` Max Krasnyansky
2008-06-26 19:19 ` Peter Zijlstra
2008-06-26 20:34 ` Paul Menage
2008-06-26 21:17 ` Paul Menage
2008-06-27 5:10 ` Max Krasnyansky [this message]
2008-06-27 5:51 ` Paul Menage
2008-06-27 17:31 ` Max Krasnyansky
2008-06-27 3:22 ` Gautham R Shenoy
2008-06-27 3:23 ` Gautham R Shenoy
2008-06-27 4:53 ` Max Krasnyansky
2008-06-27 16:42 ` 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=48647652.5050001@qualcomm.com \
--to=maxk@qualcomm.com \
--cc=a.p.zijlstra@chello.nl \
--cc=ego@in.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=menage@google.com \
--cc=pj@sgi.com \
--cc=vegard.nossum@gmail.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