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  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:	Sun, 07 Sep 2008 22:28:01 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Mike Travis <travis@....com>, Ingo Molnar <mingo@...e.hu>,
	davej@...emonkey.org.uk, David Miller <davem@...emloft.net>,
	Eric Dumazet <dada1@...mosbay.com>,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	Jack Steiner <steiner@....com>,
	Jeremy Fitzhardinge <jeremy@...p.org>,
	Jes Sorensen <jes@....com>, "H. Peter Anvin" <hpa@...or.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	linux-kernel@...r.kernel.org, Gautham R Shenoy <ego@...ibm.com>
Subject: Re: [RFC 07/13] sched: Reduce stack size requirements in
 kernel/sched.c

On Sun, 2008-09-07 at 04:00 -0700, Andrew Morton wrote:

> make cpu_hotplug.refcount an atomic_t.

That might actually be a worthwhile idea, but it will not make
get_online_cpus() atomic. The whole point of get_online_cpus() is to
serialize against actual hotplug operations, so it will have to sleep at
some point.

Now, turning cpu_hotplug.refcount into an atomic_t might be worthwhile
because it will reduce the amount of atomic operations in its fastpath
from 2 to 1.

You'd have to make recount==1 the stable situation and use
atomic_inc_unless() and atomic_dec_and_test() in get_online_cpus() and
put_online_cpus() resp. that way !refcount can signify a hotplug
operation and we'd fall back into the slow paths.

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