lkml.org 
[lkml]   [2014]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH v5 1/2] Use lock_device_hotplug() in cpu_probe_store() and cpu_release_store()
From
Date
On Thu, 2014-04-24 at 10:32 -0400, Tejun Heo wrote:
> Hello,
>
> On Thu, Apr 24, 2014 at 04:37:23PM +0800, Li Zhong wrote:
> > On Wed, 2014-04-23 at 10:39 -0400, Tejun Heo wrote:
> > After thinking it harder, I still couldn't see ABBA here ...
> >
> > the active protection taken here is for "probe/release" which will not
> > be waited for removing something like "online" under cpu#? Or my
> > assumption that s_active for different files are different locks are
> > completely wrong? Or I missed something else?
>
> I'm probably confused about the locking. I was thinking a scenario
> like the following.
>
> A. CPU on/offline
>
> grabs s_active protection of online node
> grabs cpu subsys mutex
> perform on/offline
> releases cpu subsys mutex
> releases s_active protection of online node

so the chain here is s_active(online) -> cpu_subsys_mutex

>
> B. CPU release
>
> grabs s_active protection of release node
> grabs cpu subsys mutex
> performs removal of the CPU
> removes the online node
> releases cpu subsys mutex
> releases s_active protection of release node

and the chain here is s_active(release) -> cpu_subsys_mutex ->
s_active(online)

>
> A nests cpu subsys mutex under s_active of the online node. B nests
> s_active of the online node under the cpu subsys mutex. What am I
> missing?

From the above two chain, I think the problem is cpu_subsys_mutex and
s_active(online), which is the deadlock we are trying to solve in patch
#2. I seems to me s_active(release) here doesn't have lock issues?

Thanks, Zhong

>
> Thanks.
>




\
 
 \ /
  Last update: 2014-04-25 05:41    [W:0.185 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site