diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c index 628a40a..35ce32c 100644 --- a/xen/arch/x86/numa.c +++ b/xen/arch/x86/numa.c @@ -1,8 +1,8 @@ -/* +/* * Generic VM initialization for x86-64 NUMA setups. * Copyright 2002,2003 Andi Kleen, SuSE Labs. * Adapted for Xen: Ryan Harper - */ + */ #include #include @@ -35,14 +35,16 @@ static typeof(*memnodemap) _memnodemap[64]; unsigned long memnodemapsize; u8 *memnodemap; -unsigned char cpu_to_node[NR_CPUS] __read_mostly = { - [0 ... NR_CPUS-1] = NUMA_NO_NODE +unsigned char cpu_to_node[NR_CPUS] __read_mostly = +{ + [0 ... NR_CPUS - 1] = NUMA_NO_NODE }; /* * Keep BIOS's CPU2node information, should not be used for memory allocaion */ -unsigned char apicid_to_node[MAX_LOCAL_APIC] __cpuinitdata = { - [0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE +unsigned char apicid_to_node[MAX_LOCAL_APIC] __cpuinitdata = +{ + [0 ... MAX_LOCAL_APIC - 1] = NUMA_NO_NODE }; cpumask_t node_to_cpumask[MAX_NUMNODES] __read_mostly; @@ -144,7 +146,7 @@ static int __init extract_lsb_from_nodes(const struct node *nodes, if ( nodes_used <= 1 ) i = BITS_PER_LONG - 1; else - i = find_first_bit(&bitfield, sizeof(unsigned long)*8); + i = find_first_bit(&bitfield, sizeof(unsigned long) * 8); memnodemapsize = (memtop >> i) + 1; return i; } @@ -173,7 +175,7 @@ int __init compute_hash_shift(struct node *nodes, int numnodes, } /* initialize NODE_DATA given nodeid and start/end */ void __init setup_node_bootmem(int nodeid, u64 start, u64 end) -{ +{ unsigned long start_pfn, end_pfn; start_pfn = start >> PAGE_SHIFT; @@ -184,7 +186,7 @@ void __init setup_node_bootmem(int nodeid, u64 start, u64 end) NODE_DATA(nodeid)->node_spanned_pages = end_pfn - start_pfn; node_set_online(nodeid); -} +} void __init numa_init_array(void) { @@ -215,7 +217,7 @@ static int __init numa_emulation(u64 start_pfn, u64 end_pfn) { int i; struct node nodes[MAX_NUMNODES]; - u64 sz = ((end_pfn - start_pfn)< 1 ) @@ -223,17 +225,17 @@ static int __init numa_emulation(u64 start_pfn, u64 end_pfn) u64 x = 1; while ( (x << 1) < sz ) x <<= 1; - if ( x < sz/2 ) + if ( x < sz / 2 ) printk(KERN_ERR "Numa emulation unbalanced. Complain to maintainer\n"); sz = x; } - memset(&nodes,0,sizeof(nodes)); + memset(&nodes, 0, sizeof(nodes)); for ( i = 0; i < numa_fake; i++ ) { - nodes[i].start = (start_pfn< dumping numa info (now-0x%X:%08X)\n", key, - (u32)(now>>32), (u32)now); + (u32)(now >> 32), (u32)now); - for_each_online_node ( i ) + for_each_online_node(i) { - paddr_t pa = (paddr_t)(NODE_DATA(i)->node_start_pfn + 1)<< PAGE_SHIFT; + paddr_t pa = (paddr_t)(NODE_DATA(i)->node_start_pfn + 1) << PAGE_SHIFT; printk("idx%d -> NODE%d start->%lu size->%lu free->%lu\n", i, NODE_DATA(i)->node_id, NODE_DATA(i)->node_start_pfn, @@ -385,17 +387,17 @@ static void dump_numa(unsigned char key) NODE_DATA(i)->node_id); } - for_each_online_cpu ( i ) + for_each_online_cpu(i) printk("CPU%d -> NODE%d\n", i, cpu_to_node[i]); rcu_read_lock(&domlist_read_lock); printk("Memory location of each domain:\n"); - for_each_domain ( d ) + for_each_domain(d) { printk("Domain %u (total: %u):\n", d->domain_id, d->tot_pages); - for_each_online_node ( i ) + for_each_online_node(i) page_num_node[i] = 0; spin_lock(&d->page_alloc_lock); @@ -406,14 +408,15 @@ static void dump_numa(unsigned char key) } spin_unlock(&d->page_alloc_lock); - for_each_online_node ( i ) + for_each_online_node(i) printk(" Node %u: %u\n", i, page_num_node[i]); } rcu_read_unlock(&domlist_read_lock); } -static struct keyhandler dump_numa_keyhandler = { +static struct keyhandler dump_numa_keyhandler = +{ .diagnostic = 1, .u.fn = dump_numa, .desc = "dump numa info" @@ -426,3 +429,11 @@ static __init int register_numa_trigger(void) } __initcall(register_numa_trigger); +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */