The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Koichiro Den <koichiro.den@canonical.com>, linux-kernel@vger.kernel.org
Cc: peterz@infradead.org
Subject: Re: [PATCH] cpu/hotplug: ensure the starting section runs fully regardless of target
Date: Sun, 08 Dec 2024 21:34:37 +0100	[thread overview]
Message-ID: <87zfl5q5gi.ffs@tglx> (raw)
In-Reply-To: <20241207144721.2828390-1-koichiro.den@canonical.com>

On Sat, Dec 07 2024 at 23:47, Koichiro Den wrote:
>  static int take_cpu_down(void *_param)
>  {
>  	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
> -	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
>  	int err, cpu = smp_processor_id();
>  
>  	/* Ensure this CPU doesn't handle any more interrupts. */
> @@ -1285,8 +1284,9 @@ static int take_cpu_down(void *_param)
>  
>  	/*
>  	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
> +	 * Regardless of st->target, it must run through to CPUHP_AP_OFFLINE.
>  	 */
> -	cpuhp_invoke_callback_range_nofail(false, cpu, st, target);
> +	cpuhp_invoke_callback_range_nofail(false, cpu, st, CPUHP_AP_OFFLINE);

This is really the wrong place. This want's to be enforced at the sysfs
interface already and reject writes which are between AP_OFFLINE and
AP_ONLINE.
  
It's utterly confusing to write a particular target and then magically
end up at some other state.

Thanks,

        tglx

  reply	other threads:[~2024-12-08 20:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-07 14:47 [PATCH] cpu/hotplug: ensure the starting section runs fully regardless of target Koichiro Den
2024-12-08 20:34 ` Thomas Gleixner [this message]
2024-12-09  0:12   ` Koichiro Den
2024-12-09  4:19     ` Koichiro Den
2024-12-09 10:46       ` Koichiro Den
2024-12-09 11:51       ` Thomas Gleixner
2024-12-09 12:39         ` Koichiro Den

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=87zfl5q5gi.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=koichiro.den@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    /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