Re: [PATCH] device: separate all subsys mutexes (was: Re: [BUG] potential deadlock led by cpu_hotplug lock (memcg involved))

2013-03-12 Thread Greg Kroah-Hartman
On Tue, Mar 12, 2013 at 05:09:38PM +0100, Peter Zijlstra wrote: > On Tue, 2013-03-12 at 08:43 -0700, Greg Kroah-Hartman wrote: > > On Tue, Mar 12, 2013 at 04:28:25PM +0100, Peter Zijlstra wrote: > > > On Tue, 2013-03-12 at 14:05 +0100, Michal Hocko wrote: > > > > @@ -111,17 +111,17 @@ struct

Re: [PATCH] device: separate all subsys mutexes (was: Re: [BUG] potential deadlock led by cpu_hotplug lock (memcg involved))

2013-03-12 Thread Michal Hocko
On Tue 12-03-13 16:28:25, Peter Zijlstra wrote: > On Tue, 2013-03-12 at 14:05 +0100, Michal Hocko wrote: > > @@ -111,17 +111,17 @@ struct bus_type { > > struct iommu_ops *iommu_ops; > > > > struct subsys_private *p; > > + struct lock_class_key __key; > > }; > > Is struct

Re: [PATCH] device: separate all subsys mutexes (was: Re: [BUG] potential deadlock led by cpu_hotplug lock (memcg involved))

2013-03-12 Thread Peter Zijlstra
On Tue, 2013-03-12 at 08:43 -0700, Greg Kroah-Hartman wrote: > On Tue, Mar 12, 2013 at 04:28:25PM +0100, Peter Zijlstra wrote: > > On Tue, 2013-03-12 at 14:05 +0100, Michal Hocko wrote: > > > @@ -111,17 +111,17 @@ struct bus_type { > > > struct iommu_ops *iommu_ops; > > > > > >

Re: [PATCH] device: separate all subsys mutexes (was: Re: [BUG] potential deadlock led by cpu_hotplug lock (memcg involved))

2013-03-12 Thread Greg Kroah-Hartman
On Tue, Mar 12, 2013 at 04:28:25PM +0100, Peter Zijlstra wrote: > On Tue, 2013-03-12 at 14:05 +0100, Michal Hocko wrote: > > @@ -111,17 +111,17 @@ struct bus_type { > > struct iommu_ops *iommu_ops; > > > > struct subsys_private *p; > > + struct lock_class_key __key; > > };

Re: [PATCH] device: separate all subsys mutexes (was: Re: [BUG] potential deadlock led by cpu_hotplug lock (memcg involved))

2013-03-12 Thread Peter Zijlstra
On Tue, 2013-03-12 at 14:05 +0100, Michal Hocko wrote: > @@ -111,17 +111,17 @@ struct bus_type { > struct iommu_ops *iommu_ops; > > struct subsys_private *p; > + struct lock_class_key __key; > }; Is struct bus_type constrained to static storage or can people go an

Re: [PATCH] device: separate all subsys mutexes (was: Re: [BUG] potential deadlock led by cpu_hotplug lock (memcg involved))

2013-03-12 Thread Greg Kroah-Hartman
On Tue, Mar 12, 2013 at 02:05:04PM +0100, Michal Hocko wrote: > The fix is quite simple. We can pull the key inside bus_type structure > because they are defined per device so the pointer will be unique as > well. bus_register doesn't need to be a macro anymore so change it > to the inline. We

[PATCH] device: separate all subsys mutexes (was: Re: [BUG] potential deadlock led by cpu_hotplug lock (memcg involved))

2013-03-12 Thread Michal Hocko
[CCing Greg and Kay] On Tue 12-03-13 12:07:50, Michal Hocko wrote: > [Let's CC Ingo and Peter] > > On Tue 12-03-13 11:15:55, Michal Hocko wrote: > > On Tue 12-03-13 14:36:46, Li Zefan wrote: > > > Seems a new bug in 3.9 kernel? > > > > > > > > > [ 207.271924]

[PATCH] device: separate all subsys mutexes (was: Re: [BUG] potential deadlock led by cpu_hotplug lock (memcg involved))

2013-03-12 Thread Michal Hocko
[CCing Greg and Kay] On Tue 12-03-13 12:07:50, Michal Hocko wrote: [Let's CC Ingo and Peter] On Tue 12-03-13 11:15:55, Michal Hocko wrote: On Tue 12-03-13 14:36:46, Li Zefan wrote: Seems a new bug in 3.9 kernel? [ 207.271924]

Re: [PATCH] device: separate all subsys mutexes (was: Re: [BUG] potential deadlock led by cpu_hotplug lock (memcg involved))

2013-03-12 Thread Greg Kroah-Hartman
On Tue, Mar 12, 2013 at 02:05:04PM +0100, Michal Hocko wrote: The fix is quite simple. We can pull the key inside bus_type structure because they are defined per device so the pointer will be unique as well. bus_register doesn't need to be a macro anymore so change it to the inline. We could

Re: [PATCH] device: separate all subsys mutexes (was: Re: [BUG] potential deadlock led by cpu_hotplug lock (memcg involved))

2013-03-12 Thread Peter Zijlstra
On Tue, 2013-03-12 at 14:05 +0100, Michal Hocko wrote: @@ -111,17 +111,17 @@ struct bus_type { struct iommu_ops *iommu_ops; struct subsys_private *p; + struct lock_class_key __key; }; Is struct bus_type constrained to static storage or can people go an allocate this

Re: [PATCH] device: separate all subsys mutexes (was: Re: [BUG] potential deadlock led by cpu_hotplug lock (memcg involved))

2013-03-12 Thread Greg Kroah-Hartman
On Tue, Mar 12, 2013 at 04:28:25PM +0100, Peter Zijlstra wrote: On Tue, 2013-03-12 at 14:05 +0100, Michal Hocko wrote: @@ -111,17 +111,17 @@ struct bus_type { struct iommu_ops *iommu_ops; struct subsys_private *p; + struct lock_class_key __key; }; Is struct

Re: [PATCH] device: separate all subsys mutexes (was: Re: [BUG] potential deadlock led by cpu_hotplug lock (memcg involved))

2013-03-12 Thread Peter Zijlstra
On Tue, 2013-03-12 at 08:43 -0700, Greg Kroah-Hartman wrote: On Tue, Mar 12, 2013 at 04:28:25PM +0100, Peter Zijlstra wrote: On Tue, 2013-03-12 at 14:05 +0100, Michal Hocko wrote: @@ -111,17 +111,17 @@ struct bus_type { struct iommu_ops *iommu_ops; struct

Re: [PATCH] device: separate all subsys mutexes (was: Re: [BUG] potential deadlock led by cpu_hotplug lock (memcg involved))

2013-03-12 Thread Michal Hocko
On Tue 12-03-13 16:28:25, Peter Zijlstra wrote: On Tue, 2013-03-12 at 14:05 +0100, Michal Hocko wrote: @@ -111,17 +111,17 @@ struct bus_type { struct iommu_ops *iommu_ops; struct subsys_private *p; + struct lock_class_key __key; }; Is struct bus_type

Re: [PATCH] device: separate all subsys mutexes (was: Re: [BUG] potential deadlock led by cpu_hotplug lock (memcg involved))

2013-03-12 Thread Greg Kroah-Hartman
On Tue, Mar 12, 2013 at 05:09:38PM +0100, Peter Zijlstra wrote: On Tue, 2013-03-12 at 08:43 -0700, Greg Kroah-Hartman wrote: On Tue, Mar 12, 2013 at 04:28:25PM +0100, Peter Zijlstra wrote: On Tue, 2013-03-12 at 14:05 +0100, Michal Hocko wrote: @@ -111,17 +111,17 @@ struct bus_type {