Re: [PATCH] cpu/hotplug: Fix rollback during error-out in takedown_cpu()

2018-09-06 Thread Neeraj Upadhyay
On 09/06/2018 01:48 PM, Thomas Gleixner wrote: On Thu, 6 Sep 2018, Neeraj Upadhyay wrote: On 09/05/2018 06:47 PM, Thomas Gleixner wrote: On Wed, 5 Sep 2018, Neeraj Upadhyay wrote: On 09/05/2018 05:53 PM, Thomas Gleixner wrote: And looking closer this is a general issue. Just that the TEARD

Re: [PATCH] cpu/hotplug: Fix rollback during error-out in takedown_cpu()

2018-09-06 Thread Thomas Gleixner
On Thu, 6 Sep 2018, Neeraj Upadhyay wrote: > On 09/05/2018 06:47 PM, Thomas Gleixner wrote: > > On Wed, 5 Sep 2018, Neeraj Upadhyay wrote: > > > On 09/05/2018 05:53 PM, Thomas Gleixner wrote: > > > > And looking closer this is a general issue. Just that the TEARDOWN state > > > > makes it simple to

Re: [PATCH] cpu/hotplug: Fix rollback during error-out in takedown_cpu()

2018-09-05 Thread Neeraj Upadhyay
On 09/05/2018 06:47 PM, Thomas Gleixner wrote: On Wed, 5 Sep 2018, Neeraj Upadhyay wrote: On 09/05/2018 05:53 PM, Thomas Gleixner wrote: And looking closer this is a general issue. Just that the TEARDOWN state makes it simple to observe. It's universaly broken, when the first teardown callba

Re: [PATCH] cpu/hotplug: Fix rollback during error-out in takedown_cpu()

2018-09-05 Thread Sudeep Holla
On Wed, Sep 05, 2018 at 02:23:46PM +0200, Thomas Gleixner wrote: > On Wed, 5 Sep 2018, Thomas Gleixner wrote: > > On Tue, 4 Sep 2018, Neeraj Upadhyay wrote: > > > ret = cpuhp_down_callbacks(cpu, st, target); > > > if (ret && st->state > CPUHP_TEARDOWN_CPU && st->state < prev_state) { > > > -

Re: [PATCH] cpu/hotplug: Fix rollback during error-out in takedown_cpu()

2018-09-05 Thread Thomas Gleixner
On Wed, 5 Sep 2018, Neeraj Upadhyay wrote: > On 09/05/2018 05:53 PM, Thomas Gleixner wrote: > > > > And looking closer this is a general issue. Just that the TEARDOWN state > > makes it simple to observe. It's universaly broken, when the first teardown > > callback fails because, st->state is only

Re: [PATCH] cpu/hotplug: Fix rollback during error-out in takedown_cpu()

2018-09-05 Thread Thomas Gleixner
On Wed, 5 Sep 2018, Mukesh Ojha wrote: > On 9/5/2018 5:03 PM, Thomas Gleixner wrote: > > > + st->rollback = true; > > > + st->target = prev_state; > > > + st->bringup = !st->bringup; > > No, this is just papering over the actual problem. > > > > The state inconsistency happ

Re: [PATCH] cpu/hotplug: Fix rollback during error-out in takedown_cpu()

2018-09-05 Thread Neeraj Upadhyay
On 09/05/2018 05:53 PM, Thomas Gleixner wrote: On Wed, 5 Sep 2018, Thomas Gleixner wrote: On Tue, 4 Sep 2018, Neeraj Upadhyay wrote: ret = cpuhp_down_callbacks(cpu, st, target); if (ret && st->state > CPUHP_TEARDOWN_CPU && st->state < prev_state) { - cpuhp_reset

Re: [PATCH] cpu/hotplug: Fix rollback during error-out in takedown_cpu()

2018-09-05 Thread Thomas Gleixner
On Wed, 5 Sep 2018, Thomas Gleixner wrote: > On Tue, 4 Sep 2018, Neeraj Upadhyay wrote: > > ret = cpuhp_down_callbacks(cpu, st, target); > > if (ret && st->state > CPUHP_TEARDOWN_CPU && st->state < prev_state) { > > - cpuhp_reset_state(st, prev_state); > > + /* > > +

Re: [PATCH] cpu/hotplug: Fix rollback during error-out in takedown_cpu()

2018-09-05 Thread Mukesh Ojha
On 9/5/2018 5:03 PM, Thomas Gleixner wrote: On Tue, 4 Sep 2018, Neeraj Upadhyay wrote: If takedown_cpu() fails during _cpu_down(), st->state is reset, by calling cpuhp_reset_state(). This results in an additional increment of st->state, which results in CPUHP_AP_SMPBOOT_THREADS state being sk

Re: [PATCH] cpu/hotplug: Fix rollback during error-out in takedown_cpu()

2018-09-05 Thread Thomas Gleixner
On Tue, 4 Sep 2018, Neeraj Upadhyay wrote: > If takedown_cpu() fails during _cpu_down(), st->state is reset, > by calling cpuhp_reset_state(). This results in an additional > increment of st->state, which results in CPUHP_AP_SMPBOOT_THREADS > state being skipped during rollback. Fix this by not cal

Re: [PATCH] cpu/hotplug: Fix rollback during error-out in takedown_cpu()

2018-09-04 Thread Mukesh Ojha
On 9/4/2018 12:03 PM, Neeraj Upadhyay wrote: If takedown_cpu() fails during _cpu_down(), st->state is reset, by calling cpuhp_reset_state(). This results in an additional increment of st->state, which results in CPUHP_AP_SMPBOOT_THREADS state being skipped during rollback. Fix this by not call