Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-13 Thread Toshi Kani
On Thu, 2014-02-13 at 10:56 +, Srivatsa S. Bhat wrote: > On 02/12/2014 11:48 AM, Srivatsa S. Bhat wrote: : > >>> For example, something like the code snippet shown below looks pretty > >>> neat to me: > >>> > >>> cpu_notifier_register_begin(); > >>> > >>> for_each_online_cpu(cpu) > >>>

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-13 Thread Srivatsa S. Bhat
On 02/13/2014 11:14 PM, Oleg Nesterov wrote: > On 02/12, Srivatsa S. Bhat wrote: >> >> On 02/11/2014 10:45 PM, Oleg Nesterov wrote: >>> >>> I am a bit confused... If we do this, why we can't simply turn >>> cpu_add_remove_lock into rw_semaphore? > > [...snip...] > >>

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-13 Thread Oleg Nesterov
On 02/12, Srivatsa S. Bhat wrote: > > On 02/11/2014 10:45 PM, Oleg Nesterov wrote: > > > > I am a bit confused... If we do this, why we can't simply turn > > cpu_add_remove_lock into rw_semaphore? [...snip...] > cpu_notifier_register_begin();| Run in parallel >

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-13 Thread Gautham R Shenoy
On Mon, Feb 10, 2014 at 06:26:20PM -0700, Toshi Kani wrote: > > get/put_online_cpus() is a reader-lock and concurrent executions are > allowed among the readers. They won't be serialized until a cpu > online/offline operation begins. By replacing this lock with > cpu_maps_update_begin/done(),

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-13 Thread Srivatsa S. Bhat
On 02/12/2014 11:48 AM, Srivatsa S. Bhat wrote: > On 02/12/2014 02:21 AM, Toshi Kani wrote: >> On Wed, 2014-02-12 at 00:50 +0530, Srivatsa S. Bhat wrote: >>> On 02/11/2014 11:05 PM, Toshi Kani wrote: >> : How about this? foo_cpu_notifier returns NOP when foo_notifier_ready is false.

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-13 Thread Srivatsa S. Bhat
On 02/12/2014 11:48 AM, Srivatsa S. Bhat wrote: On 02/12/2014 02:21 AM, Toshi Kani wrote: On Wed, 2014-02-12 at 00:50 +0530, Srivatsa S. Bhat wrote: On 02/11/2014 11:05 PM, Toshi Kani wrote: : How about this? foo_cpu_notifier returns NOP when foo_notifier_ready is false.

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-13 Thread Gautham R Shenoy
On Mon, Feb 10, 2014 at 06:26:20PM -0700, Toshi Kani wrote: get/put_online_cpus() is a reader-lock and concurrent executions are allowed among the readers. They won't be serialized until a cpu online/offline operation begins. By replacing this lock with cpu_maps_update_begin/done(), we now

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-13 Thread Oleg Nesterov
On 02/12, Srivatsa S. Bhat wrote: On 02/11/2014 10:45 PM, Oleg Nesterov wrote: I am a bit confused... If we do this, why we can't simply turn cpu_add_remove_lock into rw_semaphore? [...snip...] cpu_notifier_register_begin();| Run in parallel

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-13 Thread Srivatsa S. Bhat
On 02/13/2014 11:14 PM, Oleg Nesterov wrote: On 02/12, Srivatsa S. Bhat wrote: On 02/11/2014 10:45 PM, Oleg Nesterov wrote: I am a bit confused... If we do this, why we can't simply turn cpu_add_remove_lock into rw_semaphore? [...snip...] cpu_notifier_register_begin();

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-13 Thread Toshi Kani
On Thu, 2014-02-13 at 10:56 +, Srivatsa S. Bhat wrote: On 02/12/2014 11:48 AM, Srivatsa S. Bhat wrote: : For example, something like the code snippet shown below looks pretty neat to me: cpu_notifier_register_begin(); for_each_online_cpu(cpu) init_cpu(cpu);

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-11 Thread Srivatsa S. Bhat
On 02/12/2014 02:21 AM, Toshi Kani wrote: > On Wed, 2014-02-12 at 00:50 +0530, Srivatsa S. Bhat wrote: >> On 02/11/2014 11:05 PM, Toshi Kani wrote: > : >>> How about this? foo_cpu_notifier returns NOP when foo_notifier_ready is >>> false. >>> >>> register_cpu_notifier(_cpu_notifier); >>>

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-11 Thread Toshi Kani
On Wed, 2014-02-12 at 00:50 +0530, Srivatsa S. Bhat wrote: > On 02/11/2014 11:05 PM, Toshi Kani wrote: : > > How about this? foo_cpu_notifier returns NOP when foo_notifier_ready is > > false. > > > > register_cpu_notifier(_cpu_notifier); > > > > get_online_cpus(); > > > >

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-11 Thread Srivatsa S. Bhat
On 02/11/2014 11:05 PM, Toshi Kani wrote: > On Tue, 2014-02-11 at 22:48 +0530, Gautham R Shenoy wrote: >> On Tue, Feb 11, 2014 at 09:33:56AM -0700, Toshi Kani wrote: >>> >>> I agree that introducing a reader-writer semaphore allows concurrent >>> executions. Adding yet another hotplug lock is a

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-11 Thread Srivatsa S. Bhat
On 02/11/2014 10:45 PM, Oleg Nesterov wrote: > On 02/11, Srivatsa S. Bhat wrote: >> >> +static DECLARE_RWSEM(cpu_hotplug_rwsem); >> + >> +void cpu_notifier_register_begin(void) >> +{ >> +down_read(_hotplug_rwsem); >> +} >> + >> +void cpu_notifier_register_end(void) >> +{ >> +

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-11 Thread Toshi Kani
On Tue, 2014-02-11 at 22:48 +0530, Gautham R Shenoy wrote: > On Tue, Feb 11, 2014 at 09:33:56AM -0700, Toshi Kani wrote: > > > > I agree that introducing a reader-writer semaphore allows concurrent > > executions. Adding yet another hotplug lock is a bit unfortunate, > > though. > > > > I

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-11 Thread Gautham R Shenoy
On Tue, Feb 11, 2014 at 09:33:56AM -0700, Toshi Kani wrote: > > I agree that introducing a reader-writer semaphore allows concurrent > executions. Adding yet another hotplug lock is a bit unfortunate, > though. > I agree with this last part. We already have enough locks for cpu-hotplug.

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-11 Thread Oleg Nesterov
On 02/11, Srivatsa S. Bhat wrote: > > +static DECLARE_RWSEM(cpu_hotplug_rwsem); > + > +void cpu_notifier_register_begin(void) > +{ > + down_read(_hotplug_rwsem); > +} > + > +void cpu_notifier_register_end(void) > +{ > + up_read(_hotplug_rwsem); > +} > + > /* Serializes the updates to

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-11 Thread Toshi Kani
On Tue, 2014-02-11 at 09:27 +, Srivatsa S. Bhat wrote: > On 02/11/2014 06:56 AM, Toshi Kani wrote: > > On Thu, 2014-02-06 at 03:34 +0530, Srivatsa S. Bhat wrote: > > : > [...] > >> > >> Also, since cpu_maps_update_begin/done() is like a super-set of > >> get/put_online_cpus(), the former

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-11 Thread Srivatsa S. Bhat
On 02/11/2014 06:56 AM, Toshi Kani wrote: > On Thu, 2014-02-06 at 03:34 +0530, Srivatsa S. Bhat wrote: > : [...] >> >> Also, since cpu_maps_update_begin/done() is like a super-set of >> get/put_online_cpus(), the former naturally protects the critical sections >> from concurrent hotplug

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-11 Thread Srivatsa S. Bhat
On 02/11/2014 06:56 AM, Toshi Kani wrote: On Thu, 2014-02-06 at 03:34 +0530, Srivatsa S. Bhat wrote: : [...] Also, since cpu_maps_update_begin/done() is like a super-set of get/put_online_cpus(), the former naturally protects the critical sections from concurrent hotplug operations.

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-11 Thread Toshi Kani
On Tue, 2014-02-11 at 09:27 +, Srivatsa S. Bhat wrote: On 02/11/2014 06:56 AM, Toshi Kani wrote: On Thu, 2014-02-06 at 03:34 +0530, Srivatsa S. Bhat wrote: : [...] Also, since cpu_maps_update_begin/done() is like a super-set of get/put_online_cpus(), the former naturally protects

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-11 Thread Oleg Nesterov
On 02/11, Srivatsa S. Bhat wrote: +static DECLARE_RWSEM(cpu_hotplug_rwsem); + +void cpu_notifier_register_begin(void) +{ + down_read(cpu_hotplug_rwsem); +} + +void cpu_notifier_register_end(void) +{ + up_read(cpu_hotplug_rwsem); +} + /* Serializes the updates to

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-11 Thread Gautham R Shenoy
On Tue, Feb 11, 2014 at 09:33:56AM -0700, Toshi Kani wrote: I agree that introducing a reader-writer semaphore allows concurrent executions. Adding yet another hotplug lock is a bit unfortunate, though. I agree with this last part. We already have enough locks for cpu-hotplug. Another one

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-11 Thread Toshi Kani
On Tue, 2014-02-11 at 22:48 +0530, Gautham R Shenoy wrote: On Tue, Feb 11, 2014 at 09:33:56AM -0700, Toshi Kani wrote: I agree that introducing a reader-writer semaphore allows concurrent executions. Adding yet another hotplug lock is a bit unfortunate, though. I agree with this

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-11 Thread Srivatsa S. Bhat
On 02/11/2014 10:45 PM, Oleg Nesterov wrote: On 02/11, Srivatsa S. Bhat wrote: +static DECLARE_RWSEM(cpu_hotplug_rwsem); + +void cpu_notifier_register_begin(void) +{ +down_read(cpu_hotplug_rwsem); +} + +void cpu_notifier_register_end(void) +{ +up_read(cpu_hotplug_rwsem); +} +

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-11 Thread Srivatsa S. Bhat
On 02/11/2014 11:05 PM, Toshi Kani wrote: On Tue, 2014-02-11 at 22:48 +0530, Gautham R Shenoy wrote: On Tue, Feb 11, 2014 at 09:33:56AM -0700, Toshi Kani wrote: I agree that introducing a reader-writer semaphore allows concurrent executions. Adding yet another hotplug lock is a bit

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-11 Thread Toshi Kani
On Wed, 2014-02-12 at 00:50 +0530, Srivatsa S. Bhat wrote: On 02/11/2014 11:05 PM, Toshi Kani wrote: : How about this? foo_cpu_notifier returns NOP when foo_notifier_ready is false. register_cpu_notifier(foobar_cpu_notifier); get_online_cpus();

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-11 Thread Srivatsa S. Bhat
On 02/12/2014 02:21 AM, Toshi Kani wrote: On Wed, 2014-02-12 at 00:50 +0530, Srivatsa S. Bhat wrote: On 02/11/2014 11:05 PM, Toshi Kani wrote: : How about this? foo_cpu_notifier returns NOP when foo_notifier_ready is false. register_cpu_notifier(foobar_cpu_notifier);

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-10 Thread Toshi Kani
On Thu, 2014-02-06 at 03:34 +0530, Srivatsa S. Bhat wrote: : > The problem here is that callback registration takes the locks in one order > whereas the CPU hotplug operations take the same locks in the opposite order. > To avoid this issue and to provide a race-free method to register CPU

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-10 Thread Balbir Singh
On Mon, Feb 10, 2014 at 04:21:30PM +0530, Gautham R Shenoy wrote: > On Mon, Feb 10, 2014 at 02:45:55PM +0530, Srivatsa S. Bhat wrote: > > + cpuhp_lock_acquire_read(); > mutex_lock(_hotplug.lock); Don't you want to abstract cpuhp_lock_acquire_read and mutex_lock into a more useful

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-10 Thread Oleg Nesterov
On 02/10, Gautham R Shenoy wrote: > > Add lockdep annotations for get/put_online_cpus() and > cpu_hotplug_begin()/cpu_hotplug_end(). Thanks, looks good. Reviewed-by: Oleg Nesterov -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-10 Thread Srivatsa S. Bhat
On 02/10/2014 04:21 PM, Gautham R Shenoy wrote: > On Mon, Feb 10, 2014 at 02:45:55PM +0530, Srivatsa S. Bhat wrote: >> Hi Gautham, >> >> On 02/08/2014 12:41 AM, Gautham R Shenoy wrote: >>> On Thu, Feb 06, 2014 at 07:41:03PM +0100, Oleg Nesterov wrote: On 02/06, Srivatsa S. Bhat wrote: >

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-10 Thread Srivatsa S. Bhat
On 02/10/2014 05:35 PM, Gautham R Shenoy wrote: > On Mon, Feb 10, 2014 at 04:41:04PM +0530, Srivatsa S. Bhat wrote: >>> --- >> [...] >>> +/* Lockdep annotations for get/put_online_cpus() and >>> cpu_hotplug_begin/end() */ >>> +#define cpuhp_lock_acquire_read() >>>

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-10 Thread Gautham R Shenoy
On Mon, Feb 10, 2014 at 04:41:04PM +0530, Srivatsa S. Bhat wrote: > > --- > [...] > > +/* Lockdep annotations for get/put_online_cpus() and > > cpu_hotplug_begin/end() */ > > +#define cpuhp_lock_acquire_read() > > lock_map_acquire_read(_hotplug.dep_map) > > +#define cpuhp_lock_acquire()

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-10 Thread Srivatsa S. Bhat
On 02/10/2014 04:21 PM, Gautham R Shenoy wrote: > On Mon, Feb 10, 2014 at 02:45:55PM +0530, Srivatsa S. Bhat wrote: >> Hi Gautham, >> >> On 02/08/2014 12:41 AM, Gautham R Shenoy wrote: >>> On Thu, Feb 06, 2014 at 07:41:03PM +0100, Oleg Nesterov wrote: On 02/06, Srivatsa S. Bhat wrote: >

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-10 Thread Gautham R Shenoy
On Mon, Feb 10, 2014 at 02:45:55PM +0530, Srivatsa S. Bhat wrote: > Hi Gautham, > > On 02/08/2014 12:41 AM, Gautham R Shenoy wrote: > > On Thu, Feb 06, 2014 at 07:41:03PM +0100, Oleg Nesterov wrote: > >> On 02/06, Srivatsa S. Bhat wrote: > >>> > >>> The following method of CPU hotplug callback

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-10 Thread Srivatsa S. Bhat
Hi Gautham, On 02/08/2014 12:41 AM, Gautham R Shenoy wrote: > On Thu, Feb 06, 2014 at 07:41:03PM +0100, Oleg Nesterov wrote: >> On 02/06, Srivatsa S. Bhat wrote: >>> >>> The following method of CPU hotplug callback registration is not safe >>> due to the possibility of an ABBA deadlock involving

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-10 Thread Srivatsa S. Bhat
Hi Gautham, On 02/08/2014 12:41 AM, Gautham R Shenoy wrote: On Thu, Feb 06, 2014 at 07:41:03PM +0100, Oleg Nesterov wrote: On 02/06, Srivatsa S. Bhat wrote: The following method of CPU hotplug callback registration is not safe due to the possibility of an ABBA deadlock involving the

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-10 Thread Gautham R Shenoy
On Mon, Feb 10, 2014 at 02:45:55PM +0530, Srivatsa S. Bhat wrote: Hi Gautham, On 02/08/2014 12:41 AM, Gautham R Shenoy wrote: On Thu, Feb 06, 2014 at 07:41:03PM +0100, Oleg Nesterov wrote: On 02/06, Srivatsa S. Bhat wrote: The following method of CPU hotplug callback registration is

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-10 Thread Srivatsa S. Bhat
On 02/10/2014 04:21 PM, Gautham R Shenoy wrote: On Mon, Feb 10, 2014 at 02:45:55PM +0530, Srivatsa S. Bhat wrote: Hi Gautham, On 02/08/2014 12:41 AM, Gautham R Shenoy wrote: On Thu, Feb 06, 2014 at 07:41:03PM +0100, Oleg Nesterov wrote: On 02/06, Srivatsa S. Bhat wrote: The following

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-10 Thread Gautham R Shenoy
On Mon, Feb 10, 2014 at 04:41:04PM +0530, Srivatsa S. Bhat wrote: --- [...] +/* Lockdep annotations for get/put_online_cpus() and cpu_hotplug_begin/end() */ +#define cpuhp_lock_acquire_read() lock_map_acquire_read(cpu_hotplug.dep_map) +#define cpuhp_lock_acquire()

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-10 Thread Srivatsa S. Bhat
On 02/10/2014 05:35 PM, Gautham R Shenoy wrote: On Mon, Feb 10, 2014 at 04:41:04PM +0530, Srivatsa S. Bhat wrote: --- [...] +/* Lockdep annotations for get/put_online_cpus() and cpu_hotplug_begin/end() */ +#define cpuhp_lock_acquire_read() lock_map_acquire_read(cpu_hotplug.dep_map)

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-10 Thread Srivatsa S. Bhat
On 02/10/2014 04:21 PM, Gautham R Shenoy wrote: On Mon, Feb 10, 2014 at 02:45:55PM +0530, Srivatsa S. Bhat wrote: Hi Gautham, On 02/08/2014 12:41 AM, Gautham R Shenoy wrote: On Thu, Feb 06, 2014 at 07:41:03PM +0100, Oleg Nesterov wrote: On 02/06, Srivatsa S. Bhat wrote: The following

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-10 Thread Oleg Nesterov
On 02/10, Gautham R Shenoy wrote: Add lockdep annotations for get/put_online_cpus() and cpu_hotplug_begin()/cpu_hotplug_end(). Thanks, looks good. Reviewed-by: Oleg Nesterov o...@redhat.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-10 Thread Balbir Singh
On Mon, Feb 10, 2014 at 04:21:30PM +0530, Gautham R Shenoy wrote: On Mon, Feb 10, 2014 at 02:45:55PM +0530, Srivatsa S. Bhat wrote: + cpuhp_lock_acquire_read(); mutex_lock(cpu_hotplug.lock); Don't you want to abstract cpuhp_lock_acquire_read and mutex_lock into a more useful

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-10 Thread Toshi Kani
On Thu, 2014-02-06 at 03:34 +0530, Srivatsa S. Bhat wrote: : The problem here is that callback registration takes the locks in one order whereas the CPU hotplug operations take the same locks in the opposite order. To avoid this issue and to provide a race-free method to register CPU hotplug

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-07 Thread Gautham R Shenoy
On Thu, Feb 06, 2014 at 07:41:03PM +0100, Oleg Nesterov wrote: > On 02/06, Srivatsa S. Bhat wrote: > > > > The following method of CPU hotplug callback registration is not safe > > due to the possibility of an ABBA deadlock involving the cpu_add_remove_lock > > and the cpu_hotplug.lock. > >

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-07 Thread Gautham R Shenoy
On Thu, Feb 06, 2014 at 07:41:03PM +0100, Oleg Nesterov wrote: On 02/06, Srivatsa S. Bhat wrote: The following method of CPU hotplug callback registration is not safe due to the possibility of an ABBA deadlock involving the cpu_add_remove_lock and the cpu_hotplug.lock. Off-topic, but

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-06 Thread Oleg Nesterov
On 02/06, Srivatsa S. Bhat wrote: > > The following method of CPU hotplug callback registration is not safe > due to the possibility of an ABBA deadlock involving the cpu_add_remove_lock > and the cpu_hotplug.lock. Off-topic, but perhaps it also makes sense to add the lockdep annotations later,

Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-06 Thread Oleg Nesterov
On 02/06, Srivatsa S. Bhat wrote: The following method of CPU hotplug callback registration is not safe due to the possibility of an ABBA deadlock involving the cpu_add_remove_lock and the cpu_hotplug.lock. Off-topic, but perhaps it also makes sense to add the lockdep annotations later, to

[PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-05 Thread Srivatsa S. Bhat
The following method of CPU hotplug callback registration is not safe due to the possibility of an ABBA deadlock involving the cpu_add_remove_lock and the cpu_hotplug.lock. get_online_cpus(); for_each_online_cpu(cpu) init_cpu(cpu);

[PATCH 01/51] CPU hotplug: Provide lockless versions of callback registration functions

2014-02-05 Thread Srivatsa S. Bhat
The following method of CPU hotplug callback registration is not safe due to the possibility of an ABBA deadlock involving the cpu_add_remove_lock and the cpu_hotplug.lock. get_online_cpus(); for_each_online_cpu(cpu) init_cpu(cpu);