[PATCH] kernel/cpu.c: fix init_cpu_online
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Valentin Schneider <valentin.schneider@xxxxxxx>, Vincent Donnefort <vincent.donnefort@xxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, YueHaibing <yuehaibing@xxxxxxxxxx>, Yuan ZhaoXiong <yuanzhaoxiong@xxxxxxxxx>, Randy Dunlap <rdunlap@xxxxxxxxxxxxx>, Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>, linux-ia64@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
- Subject: [PATCH] kernel/cpu.c: fix init_cpu_online
- From: Yury Norov <yury.norov@xxxxxxxxx>
- Date: Sun, 30 Jan 2022 17:46:48 -0800
- Cc: Yury Norov <yury.norov@xxxxxxxxx>
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)
Signed-off-by: Yury Norov <yury.norov@xxxxxxxxx>
---
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
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]