aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/numa.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2011-10-21 09:17:42 +0200
committerJan Beulich <jbeulich@suse.com>2011-10-21 09:17:42 +0200
commit20307695e5c22a58b4cce35fba5333375da5a7fa (patch)
tree65584141fd42e108c6feca25eec190526cb01eac /xen/arch/x86/numa.c
parenta8a8a52a27513b35d1c6aa2d542074f99849ac3d (diff)
downloadxen-20307695e5c22a58b4cce35fba5333375da5a7fa.tar.gz
xen-20307695e5c22a58b4cce35fba5333375da5a7fa.tar.bz2
xen-20307695e5c22a58b4cce35fba5333375da5a7fa.zip
introduce and use nr_cpu_ids and nr_cpumask_bits
The former is the runtime equivalent of NR_CPUS (and users of NR_CPUS, where necessary, get adjusted accordingly), while the latter is for the sole use of determining the allocation size when dynamically allocating CPU masks (done later in this series). Adjust accessors to use either of the two to bound their bitmap operations - which one gets used depends on whether accessing the bits in the gap between nr_cpu_ids and nr_cpumask_bits is benign but more efficient. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/numa.c')
-rw-r--r--xen/arch/x86/numa.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c
index 28b7dd429d..61b5904a2c 100644
--- a/xen/arch/x86/numa.c
+++ b/xen/arch/x86/numa.c
@@ -198,7 +198,7 @@ void __init numa_init_array(void)
CPUs, as the number of CPUs is not known yet.
We round robin the existing nodes. */
rr = first_node(node_online_map);
- for (i = 0; i < NR_CPUS; i++) {
+ for (i = 0; i < nr_cpu_ids; i++) {
if (cpu_to_node[i] != NUMA_NO_NODE)
continue;
numa_set_node(i, rr);
@@ -280,7 +280,7 @@ void __init numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn)
memnodemap = _memnodemap;
nodes_clear(node_online_map);
node_set_online(0);
- for (i = 0; i < NR_CPUS; i++)
+ for (i = 0; i < nr_cpu_ids; i++)
numa_set_node(i, 0);
node_to_cpumask[0] = cpumask_of_cpu(0);
setup_node_bootmem(0, (u64)start_pfn << PAGE_SHIFT, (u64)end_pfn << PAGE_SHIFT);
@@ -335,7 +335,7 @@ static __init int numa_setup(char *opt)
void __init init_cpu_to_node(void)
{
int i, node;
- for (i = 0; i < NR_CPUS; i++) {
+ for (i = 0; i < nr_cpu_ids; i++) {
u32 apicid = x86_cpu_to_apicid[i];
if (apicid == BAD_APICID)
continue;