All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gautham R Shenoy <ego@in.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>,
	linux-kernel@vger.kernel.org, David Wilder <dwilder@us.ibm.com>,
	Tom Zanussi <zanussi@us.ibm.com>, Ingo Molnar <mingo@redhat.com>,
	Greg Kroah-Hartman <gregkh@suse.de>,
	Christoph Hellwig <hch@infradead.org>,
	ltt-dev@shafik.org, systemtap@sources.redhat.com,
	Douglas Niehaus <niehaus@eecs.ku.edu>,
	"Martin J. Bligh" <mbligh@mbligh.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	kiran@scalex86.org, venkatesh.pallipadi@intel.com,
	dipankar@in.ibm.com, vatsa@in.ibm.com, torvalds@osdl.org,
	davej@redhat.com
Subject: Re: [PATCH] Relay CPU Hotplug support
Date: Fri, 22 Dec 2006 16:07:24 +0530	[thread overview]
Message-ID: <20061222103724.GA29348@in.ibm.com> (raw)
In-Reply-To: <20061220232350.eb4b6a46.akpm@osdl.org>

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!"

  parent reply	other threads:[~2006-12-22 10:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-21  0:31 [PATCH] Relay CPU Hotplug support Mathieu Desnoyers
2006-12-21  1:13 ` Tom Zanussi
2006-12-21  3:22   ` Mathieu Desnoyers
2006-12-21  7:23 ` Andrew Morton
2006-12-21  7:04   ` Tom Zanussi
2006-12-22 10:37   ` Gautham R Shenoy [this message]
2006-12-22 10:44     ` Andrew Morton
2006-12-22 16:20       ` Oleg Nesterov
2006-12-22 16:42         ` Oleg Nesterov
2006-12-22 20:01       ` Gautham R Shenoy

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=20061222103724.GA29348@in.ibm.com \
    --to=ego@in.ibm.com \
    --cc=akpm@osdl.org \
    --cc=davej@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=dwilder@us.ibm.com \
    --cc=gregkh@suse.de \
    --cc=hch@infradead.org \
    --cc=kiran@scalex86.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ltt-dev@shafik.org \
    --cc=mathieu.desnoyers@polymtl.ca \
    --cc=mbligh@mbligh.org \
    --cc=mingo@redhat.com \
    --cc=niehaus@eecs.ku.edu \
    --cc=systemtap@sources.redhat.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@osdl.org \
    --cc=vatsa@in.ibm.com \
    --cc=venkatesh.pallipadi@intel.com \
    --cc=zanussi@us.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.