Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-10-27 Thread Prateek Sood
On 10/26/2017 07:35 PM, Waiman Long wrote: > On 10/26/2017 07:52 AM, Prateek Sood wrote: >> Remove circular dependency deadlock in a scenario where hotplug of CPU is >> being done while there is updation in cgroup and cpuset triggered from >> userspace. >> >> Process A => kthreadd => Process B =>

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-10-27 Thread Prateek Sood
On 10/26/2017 07:35 PM, Waiman Long wrote: > On 10/26/2017 07:52 AM, Prateek Sood wrote: >> Remove circular dependency deadlock in a scenario where hotplug of CPU is >> being done while there is updation in cgroup and cpuset triggered from >> userspace. >> >> Process A => kthreadd => Process B =>

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-10-26 Thread Waiman Long
On 10/26/2017 07:52 AM, Prateek Sood wrote: > Remove circular dependency deadlock in a scenario where hotplug of CPU is > being done while there is updation in cgroup and cpuset triggered from > userspace. > > Process A => kthreadd => Process B => Process C => Process A > > Process A >

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-10-26 Thread Waiman Long
On 10/26/2017 07:52 AM, Prateek Sood wrote: > Remove circular dependency deadlock in a scenario where hotplug of CPU is > being done while there is updation in cgroup and cpuset triggered from > userspace. > > Process A => kthreadd => Process B => Process C => Process A > > Process A >

[PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-10-26 Thread Prateek Sood
Remove circular dependency deadlock in a scenario where hotplug of CPU is being done while there is updation in cgroup and cpuset triggered from userspace. Process A => kthreadd => Process B => Process C => Process A Process A cpu_subsys_offline(); cpu_down(); _cpu_down();

[PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-10-26 Thread Prateek Sood
Remove circular dependency deadlock in a scenario where hotplug of CPU is being done while there is updation in cgroup and cpuset triggered from userspace. Process A => kthreadd => Process B => Process C => Process A Process A cpu_subsys_offline(); cpu_down(); _cpu_down();

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-10-25 Thread Peter Zijlstra
On Wed, Oct 25, 2017 at 02:09:54PM +0530, Prateek Sood wrote: > > void cpuset_update_active_cpus(void) > > { > > + mutex_lock(_mutex); > > + rebuild_sched_domains_cpuslocked(); > > + mutex_unlock(_mutex); > > } > > In the above patch rebuild_sched_domains_cpuslocked() has been > used

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-10-25 Thread Peter Zijlstra
On Wed, Oct 25, 2017 at 02:09:54PM +0530, Prateek Sood wrote: > > void cpuset_update_active_cpus(void) > > { > > + mutex_lock(_mutex); > > + rebuild_sched_domains_cpuslocked(); > > + mutex_unlock(_mutex); > > } > > In the above patch rebuild_sched_domains_cpuslocked() has been > used

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-10-25 Thread Prateek Sood
On 10/11/2017 03:18 PM, Peter Zijlstra wrote: > On Mon, Oct 09, 2017 at 06:57:46PM +0530, Prateek Sood wrote: >> On 09/07/2017 11:21 PM, Peter Zijlstra wrote: > >>> But if you invert these locks, the need for cpuset_hotplug_workfn() goes >>> away, at least for the CPU part, and we can make in

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-10-25 Thread Prateek Sood
On 10/11/2017 03:18 PM, Peter Zijlstra wrote: > On Mon, Oct 09, 2017 at 06:57:46PM +0530, Prateek Sood wrote: >> On 09/07/2017 11:21 PM, Peter Zijlstra wrote: > >>> But if you invert these locks, the need for cpuset_hotplug_workfn() goes >>> away, at least for the CPU part, and we can make in

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-10-11 Thread Peter Zijlstra
On Mon, Oct 09, 2017 at 06:57:46PM +0530, Prateek Sood wrote: > On 09/07/2017 11:21 PM, Peter Zijlstra wrote: > > But if you invert these locks, the need for cpuset_hotplug_workfn() goes > > away, at least for the CPU part, and we can make in synchronous again. > > Yay!! > The callback making a

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-10-11 Thread Peter Zijlstra
On Mon, Oct 09, 2017 at 06:57:46PM +0530, Prateek Sood wrote: > On 09/07/2017 11:21 PM, Peter Zijlstra wrote: > > But if you invert these locks, the need for cpuset_hotplug_workfn() goes > > away, at least for the CPU part, and we can make in synchronous again. > > Yay!! > The callback making a

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-10-09 Thread Prateek Sood
On 09/07/2017 11:21 PM, Peter Zijlstra wrote: > On Thu, Sep 07, 2017 at 07:26:23PM +0530, Prateek Sood wrote: >> Remove circular dependency deadlock in a scenario where hotplug of CPU is >> being done while there is updation in cgroup and cpuset triggered from >> userspace. > > You've forgotten

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-10-09 Thread Prateek Sood
On 09/07/2017 11:21 PM, Peter Zijlstra wrote: > On Thu, Sep 07, 2017 at 07:26:23PM +0530, Prateek Sood wrote: >> Remove circular dependency deadlock in a scenario where hotplug of CPU is >> being done while there is updation in cgroup and cpuset triggered from >> userspace. > > You've forgotten

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-09-07 Thread Prateek Sood
On 09/07/2017 11:15 PM, Peter Zijlstra wrote: > On Thu, Sep 07, 2017 at 07:26:23PM +0530, Prateek Sood wrote: >> Remove circular dependency deadlock in a scenario where hotplug of CPU is >> being done while there is updation in cgroup and cpuset triggered from >> userspace. >> >> Process A =>

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-09-07 Thread Prateek Sood
On 09/07/2017 11:15 PM, Peter Zijlstra wrote: > On Thu, Sep 07, 2017 at 07:26:23PM +0530, Prateek Sood wrote: >> Remove circular dependency deadlock in a scenario where hotplug of CPU is >> being done while there is updation in cgroup and cpuset triggered from >> userspace. >> >> Process A =>

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-09-07 Thread Peter Zijlstra
On Thu, Sep 07, 2017 at 07:26:23PM +0530, Prateek Sood wrote: > Remove circular dependency deadlock in a scenario where hotplug of CPU is > being done while there is updation in cgroup and cpuset triggered from > userspace. You've forgotten to mention your solution to the deadlock, namely

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-09-07 Thread Peter Zijlstra
On Thu, Sep 07, 2017 at 07:26:23PM +0530, Prateek Sood wrote: > Remove circular dependency deadlock in a scenario where hotplug of CPU is > being done while there is updation in cgroup and cpuset triggered from > userspace. You've forgotten to mention your solution to the deadlock, namely

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-09-07 Thread Peter Zijlstra
On Thu, Sep 07, 2017 at 07:26:23PM +0530, Prateek Sood wrote: > Remove circular dependency deadlock in a scenario where hotplug of CPU is > being done while there is updation in cgroup and cpuset triggered from > userspace. > > Process A => kthreadd => Process B => Process C => Process A >

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-09-07 Thread Peter Zijlstra
On Thu, Sep 07, 2017 at 07:26:23PM +0530, Prateek Sood wrote: > Remove circular dependency deadlock in a scenario where hotplug of CPU is > being done while there is updation in cgroup and cpuset triggered from > userspace. > > Process A => kthreadd => Process B => Process C => Process A >

[PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-09-07 Thread Prateek Sood
Remove circular dependency deadlock in a scenario where hotplug of CPU is being done while there is updation in cgroup and cpuset triggered from userspace. Process A => kthreadd => Process B => Process C => Process A Process A cpu_subsys_offline(); cpu_down(); _cpu_down();

[PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-09-07 Thread Prateek Sood
Remove circular dependency deadlock in a scenario where hotplug of CPU is being done while there is updation in cgroup and cpuset triggered from userspace. Process A => kthreadd => Process B => Process C => Process A Process A cpu_subsys_offline(); cpu_down(); _cpu_down();

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-09-07 Thread Prateek Sood
On 09/07/2017 02:26 PM, Boqun Feng wrote: > On Thu, Sep 07, 2017 at 09:28:48AM +0200, Peter Zijlstra wrote: >> On Thu, Sep 07, 2017 at 11:34:12AM +0530, Prateek Sood wrote: >>> Remove circular dependency deadlock in a scenario where hotplug of CPU is >>> being done while there is updation in

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-09-07 Thread Prateek Sood
On 09/07/2017 02:26 PM, Boqun Feng wrote: > On Thu, Sep 07, 2017 at 09:28:48AM +0200, Peter Zijlstra wrote: >> On Thu, Sep 07, 2017 at 11:34:12AM +0530, Prateek Sood wrote: >>> Remove circular dependency deadlock in a scenario where hotplug of CPU is >>> being done while there is updation in

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-09-07 Thread Prateek Sood
On 09/07/2017 12:58 PM, Peter Zijlstra wrote: > On Thu, Sep 07, 2017 at 11:34:12AM +0530, Prateek Sood wrote: >> Remove circular dependency deadlock in a scenario where hotplug of CPU is >> being done while there is updation in cgroup and cpuset triggered from >> userspace. >> >> Example scenario:

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-09-07 Thread Prateek Sood
On 09/07/2017 12:58 PM, Peter Zijlstra wrote: > On Thu, Sep 07, 2017 at 11:34:12AM +0530, Prateek Sood wrote: >> Remove circular dependency deadlock in a scenario where hotplug of CPU is >> being done while there is updation in cgroup and cpuset triggered from >> userspace. >> >> Example scenario:

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-09-07 Thread Boqun Feng
On Thu, Sep 07, 2017 at 09:28:48AM +0200, Peter Zijlstra wrote: > On Thu, Sep 07, 2017 at 11:34:12AM +0530, Prateek Sood wrote: > > Remove circular dependency deadlock in a scenario where hotplug of CPU is > > being done while there is updation in cgroup and cpuset triggered from > > userspace. >

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-09-07 Thread Boqun Feng
On Thu, Sep 07, 2017 at 09:28:48AM +0200, Peter Zijlstra wrote: > On Thu, Sep 07, 2017 at 11:34:12AM +0530, Prateek Sood wrote: > > Remove circular dependency deadlock in a scenario where hotplug of CPU is > > being done while there is updation in cgroup and cpuset triggered from > > userspace. >

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-09-07 Thread Peter Zijlstra
On Thu, Sep 07, 2017 at 11:34:12AM +0530, Prateek Sood wrote: > Remove circular dependency deadlock in a scenario where hotplug of CPU is > being done while there is updation in cgroup and cpuset triggered from > userspace. > > Example scenario: > kworker/0:0 => kthreadd => init:729 => init:1 =>

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-09-07 Thread Peter Zijlstra
On Thu, Sep 07, 2017 at 11:34:12AM +0530, Prateek Sood wrote: > Remove circular dependency deadlock in a scenario where hotplug of CPU is > being done while there is updation in cgroup and cpuset triggered from > userspace. > > Example scenario: > kworker/0:0 => kthreadd => init:729 => init:1 =>

[PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-09-07 Thread Prateek Sood
Remove circular dependency deadlock in a scenario where hotplug of CPU is being done while there is updation in cgroup and cpuset triggered from userspace. Example scenario: kworker/0:0 => kthreadd => init:729 => init:1 => kworker/0:0 kworker/0:0 - percpu_down_write(_hotplug_lock) [held]

[PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-09-07 Thread Prateek Sood
Remove circular dependency deadlock in a scenario where hotplug of CPU is being done while there is updation in cgroup and cpuset triggered from userspace. Example scenario: kworker/0:0 => kthreadd => init:729 => init:1 => kworker/0:0 kworker/0:0 - percpu_down_write(_hotplug_lock) [held]

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-09-06 Thread Prateek Sood
On 09/06/2017 06:26 PM, Waiman Long wrote: > On 09/06/2017 07:48 AM, Prateek Sood wrote: >> Remove circular dependency deadlock in a scenario where hotplug of CPU is >> being done while there is updation in cgroup and cpuset triggered from >> userspace. >> >> Example scenario: >> kworker/0:0 =>

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-09-06 Thread Prateek Sood
On 09/06/2017 06:26 PM, Waiman Long wrote: > On 09/06/2017 07:48 AM, Prateek Sood wrote: >> Remove circular dependency deadlock in a scenario where hotplug of CPU is >> being done while there is updation in cgroup and cpuset triggered from >> userspace. >> >> Example scenario: >> kworker/0:0 =>

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-09-06 Thread Waiman Long
On 09/06/2017 07:48 AM, Prateek Sood wrote: > Remove circular dependency deadlock in a scenario where hotplug of CPU is > being done while there is updation in cgroup and cpuset triggered from > userspace. > > Example scenario: > kworker/0:0 => kthreadd => init:729 => init:1 => kworker/0:0 > >

Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-09-06 Thread Waiman Long
On 09/06/2017 07:48 AM, Prateek Sood wrote: > Remove circular dependency deadlock in a scenario where hotplug of CPU is > being done while there is updation in cgroup and cpuset triggered from > userspace. > > Example scenario: > kworker/0:0 => kthreadd => init:729 => init:1 => kworker/0:0 > >

[PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-09-06 Thread Prateek Sood
Remove circular dependency deadlock in a scenario where hotplug of CPU is being done while there is updation in cgroup and cpuset triggered from userspace. Example scenario: kworker/0:0 => kthreadd => init:729 => init:1 => kworker/0:0 kworker/0:0 - lock(cpuhotplug.mutex) [held]

[PATCH] cgroup/cpuset: remove circular dependency deadlock

2017-09-06 Thread Prateek Sood
Remove circular dependency deadlock in a scenario where hotplug of CPU is being done while there is updation in cgroup and cpuset triggered from userspace. Example scenario: kworker/0:0 => kthreadd => init:729 => init:1 => kworker/0:0 kworker/0:0 - lock(cpuhotplug.mutex) [held]