Re: [RFC PATCH v5 1/2] Use lock_device_hotplug() in cpu_probe_store() and cpu_release_store()

2014-04-27 Thread Li Zhong
On Fri, 2014-04-25 at 08:28 -0400, Tejun Heo wrote: > On Fri, Apr 25, 2014 at 09:56:10AM +0800, Li Zhong wrote: > > > 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

Re: [RFC PATCH v5 1/2] Use lock_device_hotplug() in cpu_probe_store() and cpu_release_store()

2014-04-25 Thread Tejun Heo
On Fri, Apr 25, 2014 at 09:56:10AM +0800, Li Zhong wrote: > > 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_activ

Re: [RFC PATCH v5 1/2] Use lock_device_hotplug() in cpu_probe_store() and cpu_release_store()

2014-04-24 Thread Li Zhong
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 "pro

Re: [RFC PATCH v5 1/2] Use lock_device_hotplug() in cpu_probe_store() and cpu_release_store()

2014-04-24 Thread Tejun Heo
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

Re: [RFC PATCH v5 1/2] Use lock_device_hotplug() in cpu_probe_store() and cpu_release_store()

2014-04-24 Thread Li Zhong
On Wed, 2014-04-23 at 10:39 -0400, Tejun Heo wrote: > On Wed, Apr 23, 2014 at 10:00:26AM +0800, Li Zhong wrote: > > If you remove cpu0, then the cpu0 directory will be removed, together > > with the "online" file in the directory, while some other process might > > be writing 0 or 1 to it. > > > >

Re: [RFC PATCH v5 1/2] Use lock_device_hotplug() in cpu_probe_store() and cpu_release_store()

2014-04-23 Thread Tejun Heo
On Wed, Apr 23, 2014 at 10:00:26AM +0800, Li Zhong wrote: > If you remove cpu0, then the cpu0 directory will be removed, together > with the "online" file in the directory, while some other process might > be writing 0 or 1 to it. > > But here, for the probe/release, take "release" for example, if

Re: [RFC PATCH v5 1/2] Use lock_device_hotplug() in cpu_probe_store() and cpu_release_store()

2014-04-22 Thread Li Zhong
On Tue, 2014-04-22 at 16:40 -0400, Tejun Heo wrote: > Hello, > > On Tue, Apr 22, 2014 at 10:29:37AM +0800, Li Zhong wrote: > > The probe/release files are attribute files for cpu subsys, looks like > > following in sysfs dirs > > > > $ cd /sys/devices/system/cpu/ > > $ ls -l > > total 0 > > drwxr

Re: [RFC PATCH v5 1/2] Use lock_device_hotplug() in cpu_probe_store() and cpu_release_store()

2014-04-22 Thread Tejun Heo
Hello, On Tue, Apr 22, 2014 at 10:29:37AM +0800, Li Zhong wrote: > The probe/release files are attribute files for cpu subsys, looks like > following in sysfs dirs > > $ cd /sys/devices/system/cpu/ > $ ls -l > total 0 > drwxr-xr-x. 7 root root 0 Apr 17 19:00 cpu0 > drwxr-xr-x. 4 root root

Re: [RFC PATCH v5 1/2] Use lock_device_hotplug() in cpu_probe_store() and cpu_release_store()

2014-04-21 Thread Li Zhong
On Mon, 2014-04-21 at 18:38 -0400, Tejun Heo wrote: > Hello, > > On Mon, Apr 21, 2014 at 05:20:59PM +0800, Li Zhong wrote: > > While auditing the usage of lock_device_hotplug_sysfs() for implementing > > it in another way in following patch, it seems to me that the code here > > is to add/remove d

Re: [RFC PATCH v5 1/2] Use lock_device_hotplug() in cpu_probe_store() and cpu_release_store()

2014-04-21 Thread Tejun Heo
Hello, On Mon, Apr 21, 2014 at 05:20:59PM +0800, Li Zhong wrote: > While auditing the usage of lock_device_hotplug_sysfs() for implementing > it in another way in following patch, it seems to me that the code here > is to add/remove device, and the files probe/release for cpu bus > themselves won'

[RFC PATCH v5 1/2] Use lock_device_hotplug() in cpu_probe_store() and cpu_release_store()

2014-04-21 Thread Li Zhong
While auditing the usage of lock_device_hotplug_sysfs() for implementing it in another way in following patch, it seems to me that the code here is to add/remove device, and the files probe/release for cpu bus themselves won't be removed. So it seems to me there is no s_active related deadlock he