lkml.org 
[lkml]   [2009]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -mm] cpuhotplug: introduce try_get_online_cpus() take 3
Andrew Morton wrote:
> On Tue, 09 Jun 2009 20:07:09 +0800
> Lai Jiangshan <laijs@cn.fujitsu.com> wrote:
>
>> get_online_cpus() is a typically coarsely granular lock.
>> It's a source of ABBA deadlock.
>>
>> Thanks to the CPU notifiers, Some subsystem's global lock will
>> be required after cpu_hotplug.lock. Subsystem's global lock
>> is coarsely granular lock too, thus a lot's of lock in kernel
>> should be required after cpu_hotplug.lock(if we need
>> cpu_hotplug.lock held too)
>>
>> Otherwise it may come to a ABBA deadlock like this:
>>
>> thread 1 | thread 2
>> _cpu_down() | Lock a-kernel-lock.
>> cpu_hotplug_begin() |
>> down_write(&cpu_hotplug.lock) |
>> __raw_notifier_call_chain(CPU_DOWN_PREPARE) | get_online_cpus()
>> ------------------------------------------------------------------------
>> Lock a-kernel-lock.(wait thread2) | down_read(&cpu_hotplug.lock)
>> (wait thread 1)
>
> Confused. cpu_hotplug_begin() doesn't do
> down_write(&cpu_hotplug.lock). If it _were_ to do that then yes, we'd
> be vulnerable to the above deadlock.
>

Ouch, this changelog is modified from the V1. But it not is modified
correctly. I apologize.

Lai.



\
 
 \ /
  Last update: 2009-06-10 02:59    [W:0.099 / U:0.764 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site