From: Peter Zijlstra <peterz@infradead.org>
To: vincent.donnefort@arm.com
Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org,
valentin.schneider@arm.com
Subject: Re: [PATCH 2/4] cpu/hotplug: CPUHP_BRINGUP_CPU exception in fail injection
Date: Wed, 20 Jan 2021 13:58:35 +0100 [thread overview]
Message-ID: <YAgo+zMrbFjJ/meF@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <1610385047-92151-3-git-send-email-vincent.donnefort@arm.com>
On Mon, Jan 11, 2021 at 05:10:45PM +0000, vincent.donnefort@arm.com wrote:
> From: Vincent Donnefort <vincent.donnefort@arm.com>
>
> The atomic states (between CPUHP_AP_IDLE_DEAD and CPUHP_AP_ONLINE) are
> triggered by the CPUHP_BRINGUP_CPU step. If the latter doesn't run, none
> of the atomic can. Hence, rollback is not possible after a hotunplug
> CPUHP_BRINGUP_CPU step failure and the "fail" interface shouldn't allow
> it. Moreover, the current CPUHP_BRINGUP_CPU teardown callback
> (finish_cpu()) cannot fail anyway.
>
> Signed-off-by: Vincent Donnefort <vincent.donnefort@arm.com>
> ---
> kernel/cpu.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/cpu.c b/kernel/cpu.c
> index 9121edf..bcd7b2a 100644
> --- a/kernel/cpu.c
> +++ b/kernel/cpu.c
> @@ -2216,9 +2216,14 @@ static ssize_t write_cpuhp_fail(struct device *dev,
> return -EINVAL;
>
> /*
> - * Cannot fail STARTING/DYING callbacks.
> + * Cannot fail STARTING/DYING callbacks. Also, those callbacks are
> + * triggered by BRINGUP_CPU bringup callback. Therefore, the latter
> + * can't fail during hotunplug, as it would mean we have no way of
> + * rolling back the atomic states that have been previously teared
> + * down.
> */
> - if (cpuhp_is_atomic_state(fail))
> + if (cpuhp_is_atomic_state(fail) ||
> + (fail == CPUHP_BRINGUP_CPU && st->state > CPUHP_BRINGUP_CPU))
> return -EINVAL;
Should we instead disallow failing any state that has .cant_stop ?
next prev parent reply other threads:[~2021-01-20 14:22 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-11 17:10 [PATCH 0/4] cpu/hotplug: rollback and "fail" interface fixes vincent.donnefort
2021-01-11 17:10 ` [PATCH 1/4] cpu/hotplug: Allowing to reset fail injection vincent.donnefort
2021-01-11 17:10 ` [PATCH 2/4] cpu/hotplug: CPUHP_BRINGUP_CPU exception in " vincent.donnefort
2021-01-20 12:58 ` Peter Zijlstra [this message]
2021-01-20 15:17 ` Vincent Donnefort
2021-01-20 17:30 ` Peter Zijlstra
2021-01-11 17:10 ` [PATCH 3/4] cpu/hotplug: Add cpuhp_invoke_callback_range() vincent.donnefort
2021-01-20 13:11 ` Peter Zijlstra
2021-01-20 17:54 ` Peter Zijlstra
2021-01-20 17:45 ` Peter Zijlstra
2021-01-20 17:53 ` Peter Zijlstra
2021-01-21 10:57 ` Vincent Donnefort
2021-01-21 11:18 ` Peter Zijlstra
2021-01-20 17:49 ` Peter Zijlstra
2021-01-11 17:10 ` [PATCH 4/4] cpu/hotplug: Fix CPU down rollback vincent.donnefort
2021-01-21 14:57 ` Peter Zijlstra
2021-01-21 15:43 ` Vincent Donnefort
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=YAgo+zMrbFjJ/meF@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=valentin.schneider@arm.com \
--cc=vincent.donnefort@arm.com \
/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