From: Neeraj Upadhyay <neeraju@codeaurora.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: josh@joshtriplett.org, peterz@infradead.org, mingo@kernel.org,
jiangshanlai@gmail.com, dzickus@redhat.com,
brendan.jackman@arm.com, malat@debian.org,
linux-kernel@vger.kernel.org, sramana@codeaurora.org,
linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH] cpu/hotplug: Fix rollback during error-out in takedown_cpu()
Date: Thu, 6 Sep 2018 14:30:41 +0530 [thread overview]
Message-ID: <9b4609c6-284f-cfab-82ba-2f2bf7f1867a@codeaurora.org> (raw)
In-Reply-To: <alpine.DEB.2.21.1809061016500.1416@nanos.tec.linutronix.de>
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 TEARDOWN state
>>>>> makes it simple to observe. It's universaly broken, when the first
>>>>> teardown
>>>>> callback fails because, st->state is only decremented _AFTER_ the
>>>>> callback
>>>>> returns success, but undo_cpu_down() increments unconditionally.
>>>>>
>>>> As per my understanding, there are 2 problems here; one is fixed with your
>>>> patch, and other is cpuhp_reset_state() is used during rollback from
>>>> non-AP to
>>>> AP state, which seem to result in 2 increments of st->state (one increment
>>>> done by cpuhp_reset_state() and another by cpu_thread_fun()) .
>>> And how did your hack fix that up magically? I'll have a look later today.
>>>
>>> Thanks,
>>>
>>> tglx
>>
>> The hack fixes it by not calling cpuhp_reset_state() and doing rollback state
>> reset inline in _cpu_down().
>
> And how is that any different from the proper patch I sent? It ends up in
> the same state. So I have a hard time to understand your blurb above where
> you claim that my patch just solves one of two problems?
>
> Thanks,
>
> tglx
>
Yes, your patch solves the problem related to smpboot unparking being
skipped during rollback and with the hack we end up in same state. The
second thing, which I am referring to, is that there is one additional
state increment. I missed the part that, it could be required, so that
we reach CPUHP_AP_ONLINE_IDLE before calling __cpuhp_kick_ap(). So, it's
not a problem.
* cpuhp_reset_state() does one state increment and we reach
CPUHP_AP_ONLINE_IDLE.
if (ret && st->state > CPUHP_TEARDOWN_CPU && st->state < prev_state) {
cpuhp_reset_state(st, prev_state);
__cpuhp_kick_ap(st);
}
CPUHP_TEARDOWN_CPU,
CPUHP_AP_ONLINE_IDLE,
CPUHP_AP_SMPBOOT_THREADS,
* cpuhp_thread_fun() does one more increment before invoking state
callback (so, we skip CPUHP_AP_ONLINE_IDLE) and we reach
CPUHP_AP_SMPBOOT_THREADS:
static void cpuhp_thread_fun(unsigned int cpu)
<snip>
if (bringup) {
st->state++;
state = st->state;
<snip>
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a
member of the Code Aurora Forum, hosted by The Linux Foundation
next prev parent reply other threads:[~2018-09-06 9:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-04 6:33 [PATCH] cpu/hotplug: Fix rollback during error-out in takedown_cpu() Neeraj Upadhyay
2018-09-04 12:12 ` Mukesh Ojha
2018-09-05 11:33 ` Thomas Gleixner
2018-09-05 12:09 ` Mukesh Ojha
2018-09-05 13:14 ` Thomas Gleixner
2018-09-05 12:23 ` Thomas Gleixner
2018-09-05 12:51 ` Neeraj Upadhyay
2018-09-05 13:17 ` Thomas Gleixner
2018-09-06 2:56 ` Neeraj Upadhyay
2018-09-06 8:18 ` Thomas Gleixner
2018-09-06 9:00 ` Neeraj Upadhyay [this message]
2018-09-05 14:53 ` Sudeep Holla
2018-09-05 15:19 ` Geert Uytterhoeven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9b4609c6-284f-cfab-82ba-2f2bf7f1867a@codeaurora.org \
--to=neeraju@codeaurora.org \
--cc=brendan.jackman@arm.com \
--cc=dzickus@redhat.com \
--cc=jiangshanlai@gmail.com \
--cc=josh@joshtriplett.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=malat@debian.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=sramana@codeaurora.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).