aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorYury Norov <yury.norov@gmail.com>2022-09-05 16:08:17 -0700
committerYury Norov <yury.norov@gmail.com>2022-09-19 17:51:53 -0700
commit38bef8e57f2149acd2c910a98f57dd6291d2e0ec (patch)
treec4a62158f1967502fa801529406a5a04624048f2 /arch/x86
parentsmp: don't declare nr_cpu_ids if NR_CPUS == 1 (diff)
downloadlinux-dev-38bef8e57f2149acd2c910a98f57dd6291d2e0ec.tar.xz
linux-dev-38bef8e57f2149acd2c910a98f57dd6291d2e0ec.zip
smp: add set_nr_cpu_ids()
In preparation to support compile-time nr_cpu_ids, add a setter for the variable. This is a no-op for all arches. Signed-off-by: Yury Norov <yury.norov@gmail.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/smpboot.c4
-rw-r--r--arch/x86/xen/smp_pv.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index f24227bc3220..3f3ea0287f69 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1316,7 +1316,7 @@ static void __init smp_sanity_check(void)
nr++;
}
- nr_cpu_ids = 8;
+ set_nr_cpu_ids(8);
}
#endif
@@ -1569,7 +1569,7 @@ __init void prefill_possible_map(void)
possible = i;
}
- nr_cpu_ids = possible;
+ set_nr_cpu_ids(possible);
pr_info("Allowing %d CPUs, %d hotplug CPUs\n",
possible, max_t(int, possible - num_processors, 0));
diff --git a/arch/x86/xen/smp_pv.c b/arch/x86/xen/smp_pv.c
index ba7af2eca755..480be82e9b7b 100644
--- a/arch/x86/xen/smp_pv.c
+++ b/arch/x86/xen/smp_pv.c
@@ -179,7 +179,7 @@ static void __init _get_smp_config(unsigned int early)
* hypercall to expand the max number of VCPUs an already
* running guest has. So cap it up to X. */
if (subtract)
- nr_cpu_ids = nr_cpu_ids - subtract;
+ set_nr_cpu_ids(nr_cpu_ids - subtract);
#endif
}