lkml.org 
[lkml]   [2011]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/3] stop_machine: kill __stop_machine()
From
Date
On Thu, 2011-06-16 at 11:36 -0700, Peter Zijlstra wrote:
> On Thu, 2011-06-16 at 20:28 +0200, Tejun Heo wrote:
> > Peter, I don't think it's that simple. get_online_cpus() itself can't
> > create circular dependency by itself. It allows recursing. The chain
> > involves cpu_hotplug_begin() which returns with hotplug mutex held.
>
>
> Right, its like:
>
> mutex_lock(&a);
> get_online_cpus();
>
> vs
>
> cpu_hotplug_begin()
> mutex_lock(&a);
>
>
> that will really deadlock

Its actually like:

get_online_cpus();
mutex_lock(&a);
get_online_cpus(); <--- recursive get_online_cpus()

vs

cpu_hotplug_begin()
mutex_lock(&a);

So it can't cause deadlock in practice.

thanks,
suresh



\
 
 \ /
  Last update: 2011-06-16 20:47    [W:0.069 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site