From: Vincent Donnefort <vincent.donnefort@arm.com>
To: Yury Norov <yury.norov@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>,
Valentin Schneider <valentin.schneider@arm.com>,
Ingo Molnar <mingo@kernel.org>,
YueHaibing <yuehaibing@huawei.com>,
Yuan ZhaoXiong <yuanzhaoxiong@baidu.com>,
Randy Dunlap <rdunlap@infradead.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kernel/cpu.c: fix init_cpu_online
Date: Mon, 31 Jan 2022 11:19:57 +0000 [thread overview]
Message-ID: <YffF3e+uUIDVO7hm@FVFF7649Q05P> (raw)
In-Reply-To: <20220131014648.941629-1-yury.norov@gmail.com>
Hi Yury,
On Sun, Jan 30, 2022 at 05:46:48PM -0800, Yury Norov wrote:
> cpu_online_mask has an associate counter of online cpus, which must be
> initialized in init_cpu_online().
>
> Fixes: 0c09ab96fc82010 (cpu/hotplug: Cache number of online CPUs)
Aren't the increments/decrements from set_cpu_online() enough?
I guess we could argue that this isn't a private function and the
num_online_cpus should be updated here. But unless I missed something,
init_cpu_online() is only called in ia64 arch, in the !SMP case. Is
this the problem you're trying to tackle? If not, I'm not sure that warrants a
"Fixes:" tag
> Signed-off-by: Yury Norov <yury.norov@gmail.com>
> ---
> kernel/cpu.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/kernel/cpu.c b/kernel/cpu.c
> index 407a2568f35e..cd7605204d4d 100644
> --- a/kernel/cpu.c
> +++ b/kernel/cpu.c
> @@ -2616,6 +2616,7 @@ void init_cpu_possible(const struct cpumask *src)
> void init_cpu_online(const struct cpumask *src)
> {
> cpumask_copy(&__cpu_online_mask, src);
> + atomic_set(&__num_online_cpus, cpumask_weight(cpu_online_mask));
> }
>
> void set_cpu_online(unsigned int cpu, bool online)
> --
> 2.30.2
>
next prev parent reply other threads:[~2022-01-31 11:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-31 1:46 [PATCH] kernel/cpu.c: fix init_cpu_online Yury Norov
2022-01-31 11:19 ` Vincent Donnefort [this message]
2022-02-01 18:30 ` Yury Norov
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=YffF3e+uUIDVO7hm@FVFF7649Q05P \
--to=vincent.donnefort@arm.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rdunlap@infradead.org \
--cc=tglx@linutronix.de \
--cc=valentin.schneider@arm.com \
--cc=yuanzhaoxiong@baidu.com \
--cc=yuehaibing@huawei.com \
--cc=yury.norov@gmail.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