Re: [RFC 07/13] sched: Reduce stack size requirements in kernel/sched.c

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Peter Zijlstra
Date: Sunday, September 7, 2008 - 1:28 pm

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


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.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [RFC 07/13] sched: Reduce stack size requirements in k ..., Peter Zijlstra, (Sun Sep 7, 1:28 pm)
[RFC] CPUMASK: proposal for replacing cpumask_t, Mike Travis, (Wed Sep 10, 3:47 pm)
Re: [RFC] CPUMASK: proposal for replacing cpumask_t, Andi Kleen, (Wed Sep 10, 3:53 pm)
Re: [RFC] CPUMASK: proposal for replacing cpumask_t, Mike Travis, (Wed Sep 10, 4:33 pm)
Re: [RFC] CPUMASK: proposal for replacing cpumask_t, Andi Kleen, (Wed Sep 10, 10:21 pm)
Re: [RFC] CPUMASK: proposal for replacing cpumask_t, Peter Zijlstra, (Thu Sep 11, 2:00 am)
Re: [RFC] CPUMASK: proposal for replacing cpumask_t, Mike Travis, (Thu Sep 11, 8:04 am)
Re: [RFC] CPUMASK: proposal for replacing cpumask_t, Rusty Russell, (Thu Sep 11, 9:55 pm)
Re: [RFC] CPUMASK: proposal for replacing cpumask_t, Mike Travis, (Fri Sep 12, 7:28 am)
Re: [RFC] CPUMASK: proposal for replacing cpumask_t, Rusty Russell, (Fri Sep 12, 3:02 pm)
Re: [RFC] CPUMASK: proposal for replacing cpumask_t, Mike Travis, (Fri Sep 12, 3:50 pm)
Re: [RFC] CPUMASK: proposal for replacing cpumask_t, H. Peter Anvin, (Fri Sep 12, 3:58 pm)