lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 22 Dec 2006 16:07:24 +0530
From:	Gautham R Shenoy <ego@...ibm.com>
To:	Andrew Morton <akpm@...l.org>
Cc:	Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>,
	linux-kernel@...r.kernel.org, David Wilder <dwilder@...ibm.com>,
	Tom Zanussi <zanussi@...ibm.com>,
	Ingo Molnar <mingo@...hat.com>,
	Greg Kroah-Hartman <gregkh@...e.de>,
	Christoph Hellwig <hch@...radead.org>, ltt-dev@...fik.org,
	systemtap@...rces.redhat.com,
	Douglas Niehaus <niehaus@...s.ku.edu>,
	"Martin J. Bligh" <mbligh@...igh.org>,
	Thomas Gleixner <tglx@...utronix.de>, kiran@...lex86.org,
	venkatesh.pallipadi@...el.com, dipankar@...ibm.com,
	vatsa@...ibm.com, torvalds@...l.org, davej@...hat.com
Subject: Re: [PATCH] Relay CPU Hotplug support

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!"
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ