linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bagas Sanjaya <bagasdotme@gmail.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Regressions <regressions@lists.linux.dev>,
	Linux x86 <x86@kernel.org>
Cc: David Woodhouse <dwmw@amazon.co.uk>,
	Thomas Gleixner <tglx@linutronix.de>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Michael Kelley <mikelley@microsoft.com>,
	Oleksandr Natalenko <oleksandr@natalenko.name>,
	Helge Deller <deller@gmx.de>,
	"Guilherme G. Piccoli" <gpiccoli@igalia.com>,
	Vincent Donnefort <vdonnefort@google.com>,
	Bert Karwatzki <spasswolf@web.de>
Subject: Fwd: kernel/cpu.c: linux misses the initialization of one CPU (off-by-one regression)
Date: Mon, 29 May 2023 08:50:51 +0700	[thread overview]
Message-ID: <6a10ec48-3940-cd8d-5e34-b9ade9f87b82@gmail.com> (raw)

Hi,

I notice a regression report on Bugzilla [1]. Quoting from it:

> Since commit 18415f33e2ac4ab382cbca8b5ff82a9036b5bd49 linux misses the initialization of 1 CPU when the CONFIG_NR_CPUS is equal to the actual number of CPUs in the system. One can work around the issue by increasing CONFIG_NR_CPUS or apply the following patch:
> 
> From aa5ef661936655f0d806fdbf2d28fc9513dd5c69 Mon Sep 17 00:00:00 2001
> From: Bert Karwatzki <spasswolf@web.de>
> Date: Sun, 28 May 2023 14:35:45 +0200
> Subject: [PATCH] Fix CPU detection when CONFIG_NR_CPUS is equal to the actual
>  number of CPUs.
> 
> Signed-off-by: Bert Karwatzki <spasswolf@web.de>
> ---
>  kernel/cpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/cpu.c b/kernel/cpu.c
> index 005f863a3d2b..5e900b531827 100644
> --- a/kernel/cpu.c
> +++ b/kernel/cpu.c
> @@ -1770,7 +1770,7 @@ static void __init cpuhp_bringup_mask(const struct cpumask *mask, unsigned int n
>  	for_each_cpu(cpu, mask) {
>  		struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu);
>  
> -		if (!--ncpus)
> +		if (!ncpus--)
>  			break;
>  
>  		if (cpu_up(cpu, target) && can_rollback_cpu(st)) {
> -- 
> 2.40.1

Anyway, I'm adding it to regzbot:

#regzbot introduced: 18415f33e2ac4a https://bugzilla.kernel.org/show_bug.cgi?id=217498
#regzbot title: Off-by-one CPU initalization when CONFIG_NR_CPUS equal to actual system CPU count

Thanks.

[1]: https://bugzilla.kernel.org/show_bug.cgi?id=217498

-- 
An old man doll... just what I always wanted! - Clara

             reply	other threads:[~2023-05-29  1:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-29  1:50 Bagas Sanjaya [this message]
2023-06-20 12:36 ` Fwd: kernel/cpu.c: linux misses the initialization of one CPU (off-by-one regression) Linux regression tracking #update (Thorsten Leemhuis)

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=6a10ec48-3940-cd8d-5e34-b9ade9f87b82@gmail.com \
    --to=bagasdotme@gmail.com \
    --cc=deller@gmx.de \
    --cc=dwmw@amazon.co.uk \
    --cc=gpiccoli@igalia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikelley@microsoft.com \
    --cc=oleksandr@natalenko.name \
    --cc=peterz@infradead.org \
    --cc=regressions@lists.linux.dev \
    --cc=spasswolf@web.de \
    --cc=tglx@linutronix.de \
    --cc=vdonnefort@google.com \
    --cc=x86@kernel.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;
as well as URLs for NNTP newsgroup(s).