This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH] Relay CPU Hotplug support
- From: Gautham R Shenoy <ego at in dot ibm dot com>
- To: Andrew Morton <akpm at osdl dot org>
- Cc: Mathieu Desnoyers <mathieu dot desnoyers at polymtl dot ca>, linux-kernel at vger dot kernel dot org, David Wilder <dwilder at us dot ibm dot com>, Tom Zanussi <zanussi at us dot ibm dot com>, Ingo Molnar <mingo at redhat dot com>, Greg Kroah-Hartman <gregkh at suse dot de>, Christoph Hellwig <hch at infradead dot org>, ltt-dev at shafik dot org, systemtap at sources dot redhat dot com, Douglas Niehaus <niehaus at eecs dot ku dot edu>, "Martin J. Bligh" <mbligh at mbligh dot org>, Thomas Gleixner <tglx at linutronix dot de>, kiran at scalex86 dot org, venkatesh dot pallipadi at intel dot com, dipankar at in dot ibm dot com, vatsa at in dot ibm dot com, torvalds at osdl dot org, davej at redhat dot com
- Date: Fri, 22 Dec 2006 16:07:24 +0530
- Subject: Re: [PATCH] Relay CPU Hotplug support
- References: <20061221003101.GA28643@Krystal> <20061220232350.eb4b6a46.akpm@osdl.org>
- Reply-to: ego at in dot ibm dot com
Hi Andrew,
While we are at this per-subsystem cpuhotplug "locking", here's a
proposal that might put an end to the workqueue deadlock woes.
I'm yet to cook up a patch for this, but here's the idea in brief.
On Wed, Dec 20, 2006 at 11:23:50PM -0800, Andrew Morton wrote:
> to the relay driver. Why do that - you don't own cpu_online_map (but you
> do get some notifications when it wants to change, that's all).
How about: Let each hot-cpu-aware subsystem maintain it's own
online_cpus mask. Thus we can eliminate the global online_cpus mask
and also have a clear picture of what data the per-subsystem mutexes
are protecting :)
In kenel/cpu.c
_cpu_down()
{
send_all_pre_cpu_down_notifications();
.
.
.
send_notifications_to_lock_per_subsystem_mutexes();
__stop_machine_run();
send_notifications_to_update_per_subsystem_online_cpus_mask();
send_notifications_to_release_per_subsystem_mutexes();
.
.
.
send_all_post_cpu_down_notifications();
}
Ditto for _cpu_up().
This will not only reduce the lock-contention , but will also
allow the pre/post hotplug notifications handlers to make calls to
function which are cpu-hotplug-aware (like create_workqueue,
destroy_workqueues etc) without ending up in a recursive deadlock
as the persubsystem mutexes would have been released by then.
And since we are sending notifications to update
per_subsystem_cpus_mask before sending the
post_cpu_hotplug_notifications, the post_notification handlers
will be executing with the consistent value of the online_cpus mask.
Does anybody see a problem with this "update_now-cleanup_later"
approach ?
Thanks and Regards
gautham.
--
Gautham R Shenoy
Linux Technology Center
IBM India.
"Freedom comes with a price tag of responsibility, which is still a bargain,
because Freedom is priceless!"