Commit 9269293d authored by Matthew Dobson's avatar Matthew Dobson Committed by Linus Torvalds

[PATCH] Replace 'numnodes' with 'node_online_map' - ia64

From: Jesse Barnes <jbarnes@engr.sgi.com>

Here are some compile fixes for this patch.  Looks like simple typos.
Signed-off-by: default avatarJesse Barnes <jbarnes@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3576d385
...@@ -445,16 +445,20 @@ acpi_numa_arch_fixup (void) ...@@ -445,16 +445,20 @@ acpi_numa_arch_fixup (void)
return; return;
} }
/*
* MCD - This can probably be dropped now. No need for pxm ID to node ID
* mapping with sparse node numbering iff MAX_PXM_DOMAINS <= MAX_NUMNODES.
*/
/* calculate total number of nodes in system from PXM bitmap */ /* calculate total number of nodes in system from PXM bitmap */
numnodes = 0; /* init total nodes in system */
memset(pxm_to_nid_map, -1, sizeof(pxm_to_nid_map)); memset(pxm_to_nid_map, -1, sizeof(pxm_to_nid_map));
memset(nid_to_pxm_map, -1, sizeof(nid_to_pxm_map)); memset(nid_to_pxm_map, -1, sizeof(nid_to_pxm_map));
nodes_clear(node_online_map);
for (i = 0; i < MAX_PXM_DOMAINS; i++) { for (i = 0; i < MAX_PXM_DOMAINS; i++) {
if (pxm_bit_test(i)) { if (pxm_bit_test(i)) {
pxm_to_nid_map[i] = numnodes; int nid = num_online_nodes();
node_set_online(numnodes); pxm_to_nid_map[i] = nid;
nid_to_pxm_map[numnodes++] = i; nid_to_pxm_map[nid] = i;
node_set_online(nid);
} }
} }
...@@ -463,7 +467,7 @@ acpi_numa_arch_fixup (void) ...@@ -463,7 +467,7 @@ acpi_numa_arch_fixup (void)
node_memblk[i].nid = pxm_to_nid_map[node_memblk[i].nid]; node_memblk[i].nid = pxm_to_nid_map[node_memblk[i].nid];
/* assign memory bank numbers for each chunk on each node */ /* assign memory bank numbers for each chunk on each node */
for (i = 0; i < numnodes; i++) { for_each_online_node(i) {
int bank; int bank;
bank = 0; bank = 0;
...@@ -476,7 +480,7 @@ acpi_numa_arch_fixup (void) ...@@ -476,7 +480,7 @@ acpi_numa_arch_fixup (void)
for (i = 0; i < srat_num_cpus; i++) for (i = 0; i < srat_num_cpus; i++)
node_cpuid[i].nid = pxm_to_nid_map[node_cpuid[i].nid]; node_cpuid[i].nid = pxm_to_nid_map[node_cpuid[i].nid];
printk(KERN_INFO "Number of logical nodes in system = %d\n", numnodes); printk(KERN_INFO "Number of logical nodes in system = %d\n", num_online_nodes());
printk(KERN_INFO "Number of memory chunks in system = %d\n", num_node_memblks); printk(KERN_INFO "Number of memory chunks in system = %d\n", num_node_memblks);
if (!slit_table) return; if (!slit_table) return;
...@@ -496,8 +500,8 @@ acpi_numa_arch_fixup (void) ...@@ -496,8 +500,8 @@ acpi_numa_arch_fixup (void)
#ifdef SLIT_DEBUG #ifdef SLIT_DEBUG
printk("ACPI 2.0 SLIT locality table:\n"); printk("ACPI 2.0 SLIT locality table:\n");
for (i = 0; i < numnodes; i++) { for_each_online_node(i) {
for (j = 0; j < numnodes; j++) for_each_online_node(j)
printk("%03d ", node_distance(i,j)); printk("%03d ", node_distance(i,j));
printk("\n"); printk("\n");
} }
......
...@@ -68,7 +68,8 @@ static int __init topology_init(void) ...@@ -68,7 +68,8 @@ static int __init topology_init(void)
} }
memset(sysfs_nodes, 0, sizeof(struct node) * MAX_NUMNODES); memset(sysfs_nodes, 0, sizeof(struct node) * MAX_NUMNODES);
for (i = 0; i < numnodes; i++) /* MCD - Do we want to register all ONLINE nodes, or all POSSIBLE nodes? */
for_each_online_node(i)
if ((err = register_node(&sysfs_nodes[i], i, 0))) if ((err = register_node(&sysfs_nodes[i], i, 0)))
goto out; goto out;
#endif #endif
......
...@@ -39,7 +39,7 @@ struct early_node_data { ...@@ -39,7 +39,7 @@ struct early_node_data {
unsigned long max_pfn; unsigned long max_pfn;
}; };
static struct early_node_data mem_data[NR_NODES] __initdata; static struct early_node_data mem_data[MAX_NUMNODES] __initdata;
/** /**
* reassign_cpu_only_nodes - called from find_memory to move CPU-only nodes to a memory node * reassign_cpu_only_nodes - called from find_memory to move CPU-only nodes to a memory node
...@@ -56,9 +56,9 @@ static void __init reassign_cpu_only_nodes(void) ...@@ -56,9 +56,9 @@ static void __init reassign_cpu_only_nodes(void)
struct node_memblk_s *p; struct node_memblk_s *p;
int i, j, k, nnode, nid, cpu, cpunid, pxm; int i, j, k, nnode, nid, cpu, cpunid, pxm;
u8 cslit, slit; u8 cslit, slit;
static DECLARE_BITMAP(nodes_with_mem, NR_NODES) __initdata; static DECLARE_BITMAP(nodes_with_mem, MAX_NUMNODES) __initdata;
static u8 numa_slit_fix[MAX_NUMNODES * MAX_NUMNODES] __initdata; static u8 numa_slit_fix[MAX_NUMNODES * MAX_NUMNODES] __initdata;
static int node_flip[NR_NODES] __initdata; static int node_flip[MAX_NUMNODES] __initdata;
static int old_nid_map[NR_CPUS] __initdata; static int old_nid_map[NR_CPUS] __initdata;
for (nnode = 0, p = &node_memblk[0]; p < &node_memblk[num_node_memblks]; p++) for (nnode = 0, p = &node_memblk[0]; p < &node_memblk[num_node_memblks]; p++)
...@@ -70,7 +70,7 @@ static void __init reassign_cpu_only_nodes(void) ...@@ -70,7 +70,7 @@ static void __init reassign_cpu_only_nodes(void)
/* /*
* All nids with memory. * All nids with memory.
*/ */
if (nnode == numnodes) if (nnode == num_online_nodes())
return; return;
/* /*
...@@ -79,10 +79,17 @@ static void __init reassign_cpu_only_nodes(void) ...@@ -79,10 +79,17 @@ static void __init reassign_cpu_only_nodes(void)
* For reassigned CPU nodes a nid can't be arrived at * For reassigned CPU nodes a nid can't be arrived at
* until after this loop because the target nid's new * until after this loop because the target nid's new
* identity might not have been established yet. So * identity might not have been established yet. So
* new nid values are fabricated above numnodes and * new nid values are fabricated above num_online_nodes() and
* mapped back later to their true value. * mapped back later to their true value.
*/ */
for (nid = 0, i = 0; i < numnodes; i++) { /* MCD - This code is a bit complicated, but may be unnecessary now.
* We can now handle much more interesting node-numbering.
* The old requirement that 0 <= nid <= numnodes <= MAX_NUMNODES
* and that there be no holes in the numbering 0..numnodes
* has become simply 0 <= nid <= MAX_NUMNODES.
*/
nid = 0;
for_each_online_node(i) {
if (test_bit(i, (void *) nodes_with_mem)) { if (test_bit(i, (void *) nodes_with_mem)) {
/* /*
* Save original nid value for numa_slit * Save original nid value for numa_slit
...@@ -102,7 +109,7 @@ static void __init reassign_cpu_only_nodes(void) ...@@ -102,7 +109,7 @@ static void __init reassign_cpu_only_nodes(void)
cpunid = nid; cpunid = nid;
nid++; nid++;
} else } else
cpunid = numnodes; cpunid = MAX_NUMNODES;
for (cpu = 0; cpu < NR_CPUS; cpu++) for (cpu = 0; cpu < NR_CPUS; cpu++)
if (node_cpuid[cpu].nid == i) { if (node_cpuid[cpu].nid == i) {
...@@ -110,7 +117,7 @@ static void __init reassign_cpu_only_nodes(void) ...@@ -110,7 +117,7 @@ static void __init reassign_cpu_only_nodes(void)
* For nodes not being reassigned just * For nodes not being reassigned just
* fix the cpu's nid and reverse pxm map * fix the cpu's nid and reverse pxm map
*/ */
if (cpunid < numnodes) { if (cpunid < MAX_NUMNODES) {
pxm = nid_to_pxm_map[i]; pxm = nid_to_pxm_map[i];
pxm_to_nid_map[pxm] = pxm_to_nid_map[pxm] =
node_cpuid[cpu].nid = cpunid; node_cpuid[cpu].nid = cpunid;
...@@ -120,18 +127,21 @@ static void __init reassign_cpu_only_nodes(void) ...@@ -120,18 +127,21 @@ static void __init reassign_cpu_only_nodes(void)
/* /*
* For nodes being reassigned, find best node by * For nodes being reassigned, find best node by
* numa_slit information and then make a temporary * numa_slit information and then make a temporary
* nid value based on current nid and numnodes. * nid value based on current nid and num_online_nodes().
*/ */
for (slit = 0xff, k = numnodes + numnodes, j = 0; j < numnodes; j++) slit = 0xff;
k = 2*num_online_nodes();
for_each_online_node(j) {
if (i == j) if (i == j)
continue; continue;
else if (test_bit(j, (void *) nodes_with_mem)) { else if (test_bit(j, (void *) nodes_with_mem)) {
cslit = numa_slit[i * numnodes + j]; cslit = numa_slit[i * num_online_nodes() + j];
if (cslit < slit) { if (cslit < slit) {
k = numnodes + j; k = num_online_nodes() + j;
slit = cslit; slit = cslit;
} }
} }
}
/* save old nid map so we can update the pxm */ /* save old nid map so we can update the pxm */
old_nid_map[cpu] = node_cpuid[cpu].nid; old_nid_map[cpu] = node_cpuid[cpu].nid;
...@@ -143,12 +153,12 @@ static void __init reassign_cpu_only_nodes(void) ...@@ -143,12 +153,12 @@ static void __init reassign_cpu_only_nodes(void)
* Fixup temporary nid values for CPU-only nodes. * Fixup temporary nid values for CPU-only nodes.
*/ */
for (cpu = 0; cpu < NR_CPUS; cpu++) for (cpu = 0; cpu < NR_CPUS; cpu++)
if (node_cpuid[cpu].nid == (numnodes + numnodes)) { if (node_cpuid[cpu].nid == (2*num_online_nodes())) {
pxm = nid_to_pxm_map[old_nid_map[cpu]]; pxm = nid_to_pxm_map[old_nid_map[cpu]];
pxm_to_nid_map[pxm] = node_cpuid[cpu].nid = nnode - 1; pxm_to_nid_map[pxm] = node_cpuid[cpu].nid = nnode - 1;
} else { } else {
for (i = 0; i < nnode; i++) { for (i = 0; i < nnode; i++) {
if (node_flip[i] != (node_cpuid[cpu].nid - numnodes)) if (node_flip[i] != (node_cpuid[cpu].nid - num_online_nodes()))
continue; continue;
pxm = nid_to_pxm_map[old_nid_map[cpu]]; pxm = nid_to_pxm_map[old_nid_map[cpu]];
...@@ -164,14 +174,13 @@ static void __init reassign_cpu_only_nodes(void) ...@@ -164,14 +174,13 @@ static void __init reassign_cpu_only_nodes(void)
for (i = 0; i < nnode; i++) for (i = 0; i < nnode; i++)
for (j = 0; j < nnode; j++) for (j = 0; j < nnode; j++)
numa_slit_fix[i * nnode + j] = numa_slit_fix[i * nnode + j] =
numa_slit[node_flip[i] * numnodes + node_flip[j]]; numa_slit[node_flip[i] * num_online_nodes() + node_flip[j]];
memcpy(numa_slit, numa_slit_fix, sizeof (numa_slit)); memcpy(numa_slit, numa_slit_fix, sizeof (numa_slit));
for (i = nnode; i < numnodes; i++) nodes_clear(node_online_map);
node_set_offline(i); for (i = 0; i < nnode; i++)
node_set_online(i);
numnodes = nnode;
return; return;
} }
...@@ -370,7 +379,7 @@ static void __init reserve_pernode_space(void) ...@@ -370,7 +379,7 @@ static void __init reserve_pernode_space(void)
struct bootmem_data *bdp; struct bootmem_data *bdp;
int node; int node;
for (node = 0; node < numnodes; node++) { for_each_online_node(node) {
pg_data_t *pdp = mem_data[node].pgdat; pg_data_t *pdp = mem_data[node].pgdat;
bdp = pdp->bdata; bdp = pdp->bdata;
...@@ -399,13 +408,13 @@ static void __init reserve_pernode_space(void) ...@@ -399,13 +408,13 @@ static void __init reserve_pernode_space(void)
static void __init initialize_pernode_data(void) static void __init initialize_pernode_data(void)
{ {
int cpu, node; int cpu, node;
pg_data_t *pgdat_list[NR_NODES]; pg_data_t *pgdat_list[MAX_NUMNODES];
for (node = 0; node < numnodes; node++) for_each_online_node(node)
pgdat_list[node] = mem_data[node].pgdat; pgdat_list[node] = mem_data[node].pgdat;
/* Copy the pg_data_t list to each node and init the node field */ /* Copy the pg_data_t list to each node and init the node field */
for (node = 0; node < numnodes; node++) { for_each_online_node(node) {
memcpy(mem_data[node].node_data->pg_data_ptrs, pgdat_list, memcpy(mem_data[node].node_data->pg_data_ptrs, pgdat_list,
sizeof(pgdat_list)); sizeof(pgdat_list));
} }
...@@ -429,15 +438,15 @@ void __init find_memory(void) ...@@ -429,15 +438,15 @@ void __init find_memory(void)
reserve_memory(); reserve_memory();
if (numnodes == 0) { if (num_online_nodes() == 0) {
printk(KERN_ERR "node info missing!\n"); printk(KERN_ERR "node info missing!\n");
numnodes = 1; node_set_online(0);
} }
min_low_pfn = -1; min_low_pfn = -1;
max_low_pfn = 0; max_low_pfn = 0;
if (numnodes > 1) if (num_online_nodes() > 1)
reassign_cpu_only_nodes(); reassign_cpu_only_nodes();
/* These actually end up getting called by call_pernode_memory() */ /* These actually end up getting called by call_pernode_memory() */
...@@ -448,10 +457,13 @@ void __init find_memory(void) ...@@ -448,10 +457,13 @@ void __init find_memory(void)
* Initialize the boot memory maps in reverse order since that's * Initialize the boot memory maps in reverse order since that's
* what the bootmem allocator expects * what the bootmem allocator expects
*/ */
for (node = numnodes - 1; node >= 0; node--) { for (node = MAX_NUMNODES - 1; node >= 0; node--) {
unsigned long pernode, pernodesize, map; unsigned long pernode, pernodesize, map;
struct bootmem_data *bdp; struct bootmem_data *bdp;
if (!node_online(node))
continue;
bdp = &mem_data[node].bootmem_data; bdp = &mem_data[node].bootmem_data;
pernode = mem_data[node].pernode_addr; pernode = mem_data[node].pernode_addr;
pernodesize = mem_data[node].pernode_size; pernodesize = mem_data[node].pernode_size;
...@@ -638,12 +650,12 @@ void __init paging_init(void) ...@@ -638,12 +650,12 @@ void __init paging_init(void)
max_dma = virt_to_phys((void *) MAX_DMA_ADDRESS) >> PAGE_SHIFT; max_dma = virt_to_phys((void *) MAX_DMA_ADDRESS) >> PAGE_SHIFT;
/* so min() will work in count_node_pages */ /* so min() will work in count_node_pages */
for (node = 0; node < numnodes; node++) for_each_online_node(node)
mem_data[node].min_pfn = ~0UL; mem_data[node].min_pfn = ~0UL;
efi_memmap_walk(filter_rsvd_memory, count_node_pages); efi_memmap_walk(filter_rsvd_memory, count_node_pages);
for (node = 0; node < numnodes; node++) { for_each_online_node(node) {
memset(zones_size, 0, sizeof(zones_size)); memset(zones_size, 0, sizeof(zones_size));
memset(zholes_size, 0, sizeof(zholes_size)); memset(zholes_size, 0, sizeof(zholes_size));
......
...@@ -382,7 +382,7 @@ void hubdev_init_node(nodepda_t * npda, cnodeid_t node) ...@@ -382,7 +382,7 @@ void hubdev_init_node(nodepda_t * npda, cnodeid_t node)
struct hubdev_info *hubdev_info; struct hubdev_info *hubdev_info;
if (node >= numnodes) /* Headless/memless IO nodes */ if (node >= num_online_nodes()) /* Headless/memless IO nodes */
hubdev_info = hubdev_info =
(struct hubdev_info *)alloc_bootmem_node(NODE_DATA(0), (struct hubdev_info *)alloc_bootmem_node(NODE_DATA(0),
sizeof(struct sizeof(struct
......
...@@ -224,9 +224,10 @@ static void __init sn_check_for_wars(void) ...@@ -224,9 +224,10 @@ static void __init sn_check_for_wars(void)
{ {
int cnode; int cnode;
for (cnode = 0; cnode < numnodes; cnode++) for_each_online_node(cnode) {
if (is_shub_1_1(cnodeid_to_nasid(cnode))) if (is_shub_1_1(cnodeid_to_nasid(cnode)))
shub_1_1_found = 1; shub_1_1_found = 1;
}
} }
/** /**
...@@ -346,17 +347,17 @@ void __init sn_init_pdas(char **cmdline_p) ...@@ -346,17 +347,17 @@ void __init sn_init_pdas(char **cmdline_p)
memset(pda->cnodeid_to_nasid_table, -1, memset(pda->cnodeid_to_nasid_table, -1,
sizeof(pda->cnodeid_to_nasid_table)); sizeof(pda->cnodeid_to_nasid_table));
for (cnode = 0; cnode < numnodes; cnode++) for_each_online_node(cnode)
pda->cnodeid_to_nasid_table[cnode] = pda->cnodeid_to_nasid_table[cnode] =
pxm_to_nasid(nid_to_pxm_map[cnode]); pxm_to_nasid(nid_to_pxm_map[cnode]);
numionodes = numnodes; numionodes = num_online_nodes();
scan_for_ionodes(); scan_for_ionodes();
/* /*
* Allocate & initalize the nodepda for each node. * Allocate & initalize the nodepda for each node.
*/ */
for (cnode = 0; cnode < numnodes; cnode++) { for_each_online_node(cnode) {
nodepdaindr[cnode] = nodepdaindr[cnode] =
alloc_bootmem_node(NODE_DATA(cnode), sizeof(nodepda_t)); alloc_bootmem_node(NODE_DATA(cnode), sizeof(nodepda_t));
memset(nodepdaindr[cnode], 0, sizeof(nodepda_t)); memset(nodepdaindr[cnode], 0, sizeof(nodepda_t));
...@@ -367,7 +368,7 @@ void __init sn_init_pdas(char **cmdline_p) ...@@ -367,7 +368,7 @@ void __init sn_init_pdas(char **cmdline_p)
/* /*
* Allocate & initialize nodepda for TIOs. For now, put them on node 0. * Allocate & initialize nodepda for TIOs. For now, put them on node 0.
*/ */
for (cnode = numnodes; cnode < numionodes; cnode++) { for (cnode = num_online_nodes(); cnode < numionodes; cnode++) {
nodepdaindr[cnode] = nodepdaindr[cnode] =
alloc_bootmem_node(NODE_DATA(0), sizeof(nodepda_t)); alloc_bootmem_node(NODE_DATA(0), sizeof(nodepda_t));
memset(nodepdaindr[cnode], 0, sizeof(nodepda_t)); memset(nodepdaindr[cnode], 0, sizeof(nodepda_t));
...@@ -385,7 +386,7 @@ void __init sn_init_pdas(char **cmdline_p) ...@@ -385,7 +386,7 @@ void __init sn_init_pdas(char **cmdline_p)
* The following routine actually sets up the hubinfo struct * The following routine actually sets up the hubinfo struct
* in nodepda. * in nodepda.
*/ */
for (cnode = 0; cnode < numnodes; cnode++) { for_each_online_node(cnode) {
bte_init_node(nodepdaindr[cnode], cnode); bte_init_node(nodepdaindr[cnode], cnode);
} }
...@@ -431,7 +432,7 @@ void __init sn_cpu_init(void) ...@@ -431,7 +432,7 @@ void __init sn_cpu_init(void)
if (ia64_sn_get_sapic_info(cpuphyid, &nasid, &subnode, &slice)) if (ia64_sn_get_sapic_info(cpuphyid, &nasid, &subnode, &slice))
BUG(); BUG();
for (i=0; i < NR_NODES; i++) { for (i=0; i < MAX_NUMNODES; i++) {
if (nodepdaindr[i]) { if (nodepdaindr[i]) {
nodepdaindr[i]->phys_cpuid[cpuid].nasid = nasid; nodepdaindr[i]->phys_cpuid[cpuid].nasid = nasid;
nodepdaindr[i]->phys_cpuid[cpuid].slice = slice; nodepdaindr[i]->phys_cpuid[cpuid].slice = slice;
...@@ -484,7 +485,7 @@ void __init sn_cpu_init(void) ...@@ -484,7 +485,7 @@ void __init sn_cpu_init(void)
int buddy_nasid; int buddy_nasid;
buddy_nasid = buddy_nasid =
cnodeid_to_nasid(numa_node_id() == cnodeid_to_nasid(numa_node_id() ==
numnodes - 1 ? 0 : numa_node_id() + 1); num_online_nodes() - 1 ? 0 : numa_node_id() + 1);
pda->pio_shub_war_cam_addr = pda->pio_shub_war_cam_addr =
(volatile unsigned long *)GLOBAL_MMR_ADDR(nasid, (volatile unsigned long *)GLOBAL_MMR_ADDR(nasid,
SH_PI_CAM_CONTROL); SH_PI_CAM_CONTROL);
......
...@@ -233,14 +233,13 @@ int __init prominfo_init(void) ...@@ -233,14 +233,13 @@ int __init prominfo_init(void)
if (!ia64_platform_is("sn2")) if (!ia64_platform_is("sn2"))
return 0; return 0;
proc_entries = kmalloc(numnodes * sizeof(struct proc_dir_entry *), proc_entries = kmalloc(num_online_nodes() * sizeof(struct proc_dir_entry *),
GFP_KERNEL); GFP_KERNEL);
sgi_prominfo_entry = proc_mkdir("sgi_prominfo", NULL); sgi_prominfo_entry = proc_mkdir("sgi_prominfo", NULL);
for (cnodeid = 0, entp = proc_entries; entp = proc_entries;
cnodeid < numnodes; for_each_online_node(cnodeid) {
cnodeid++, entp++) {
sprintf(name, "node%d", cnodeid); sprintf(name, "node%d", cnodeid);
*entp = proc_mkdir(name, sgi_prominfo_entry); *entp = proc_mkdir(name, sgi_prominfo_entry);
nasid = cnodeid_to_nasid(cnodeid); nasid = cnodeid_to_nasid(cnodeid);
...@@ -254,6 +253,7 @@ int __init prominfo_init(void) ...@@ -254,6 +253,7 @@ int __init prominfo_init(void)
(void *)nasid); (void *)nasid);
if (p) if (p)
p->owner = THIS_MODULE; p->owner = THIS_MODULE;
entp++;
} }
return 0; return 0;
...@@ -265,12 +265,13 @@ void __exit prominfo_exit(void) ...@@ -265,12 +265,13 @@ void __exit prominfo_exit(void)
unsigned cnodeid; unsigned cnodeid;
char name[NODE_NAME_LEN]; char name[NODE_NAME_LEN];
for (cnodeid = 0, entp = proc_entries; entp = proc_entries;
cnodeid < numnodes; cnodeid++, entp++) { for_each_online_node(cnodeid) {
remove_proc_entry("fit", *entp); remove_proc_entry("fit", *entp);
remove_proc_entry("version", *entp); remove_proc_entry("version", *entp);
sprintf(name, "node%d", cnodeid); sprintf(name, "node%d", cnodeid);
remove_proc_entry(name, sgi_prominfo_entry); remove_proc_entry(name, sgi_prominfo_entry);
entp++;
} }
remove_proc_entry("sgi_prominfo", NULL); remove_proc_entry("sgi_prominfo", NULL);
kfree(proc_entries); kfree(proc_entries);
......
...@@ -92,16 +92,15 @@ sn2_global_tlb_purge(unsigned long start, unsigned long end, ...@@ -92,16 +92,15 @@ sn2_global_tlb_purge(unsigned long start, unsigned long end,
volatile unsigned long *ptc0, *ptc1; volatile unsigned long *ptc0, *ptc1;
unsigned long flags = 0, data0, data1; unsigned long flags = 0, data0, data1;
struct mm_struct *mm = current->active_mm; struct mm_struct *mm = current->active_mm;
short nasids[NR_NODES], nix; short nasids[MAX_NUMNODES], nix;
DECLARE_BITMAP(nodes_flushed, NR_NODES); nodemask_t nodes_flushed;
bitmap_zero(nodes_flushed, NR_NODES);
nodes_clear(nodes_flushed);
i = 0; i = 0;
for_each_cpu_mask(cpu, mm->cpu_vm_mask) { for_each_cpu_mask(cpu, mm->cpu_vm_mask) {
cnode = cpu_to_node(cpu); cnode = cpu_to_node(cpu);
__set_bit(cnode, nodes_flushed); node_set(cnode, nodes_flushed);
lcpu = cpu; lcpu = cpu;
i++; i++;
} }
...@@ -125,8 +124,7 @@ sn2_global_tlb_purge(unsigned long start, unsigned long end, ...@@ -125,8 +124,7 @@ sn2_global_tlb_purge(unsigned long start, unsigned long end,
} }
nix = 0; nix = 0;
for (cnode = find_first_bit(&nodes_flushed, NR_NODES); cnode < NR_NODES; for_each_node_mask(cnode, nodes_flushed)
cnode = find_next_bit(&nodes_flushed, NR_NODES, ++cnode))
nasids[nix++] = cnodeid_to_nasid(cnode); nasids[nix++] = cnodeid_to_nasid(cnode);
data0 = (1UL << SH_PTC_0_A_SHFT) | data0 = (1UL << SH_PTC_0_A_SHFT) |
...@@ -194,7 +192,7 @@ void sn2_ptc_deadlock_recovery(unsigned long data0, unsigned long data1) ...@@ -194,7 +192,7 @@ void sn2_ptc_deadlock_recovery(unsigned long data0, unsigned long data1)
mycnode = numa_node_id(); mycnode = numa_node_id();
for (cnode = 0; cnode < numnodes; cnode++) { for_each_online_node(cnode) {
if (is_headless_node(cnode) || cnode == mycnode) if (is_headless_node(cnode) || cnode == mycnode)
continue; continue;
nasid = cnodeid_to_nasid(cnode); nasid = cnodeid_to_nasid(cnode);
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#ifndef _ASM_IA64_MMZONE_H #ifndef _ASM_IA64_MMZONE_H
#define _ASM_IA64_MMZONE_H #define _ASM_IA64_MMZONE_H
#include <linux/config.h> #include <linux/numa.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/meminit.h> #include <asm/meminit.h>
...@@ -19,15 +19,14 @@ ...@@ -19,15 +19,14 @@
#ifdef CONFIG_IA64_DIG /* DIG systems are small */ #ifdef CONFIG_IA64_DIG /* DIG systems are small */
# define MAX_PHYSNODE_ID 8 # define MAX_PHYSNODE_ID 8
# define NR_NODES 8 # define NR_NODE_MEMBLKS (MAX_NUMNODES * 8)
# define NR_NODE_MEMBLKS (NR_NODES * 8)
#else /* sn2 is the biggest case, so we use that if !DIG */ #else /* sn2 is the biggest case, so we use that if !DIG */
# define MAX_PHYSNODE_ID 2048 # define MAX_PHYSNODE_ID 2048
# define NR_NODES 256 # define NR_NODE_MEMBLKS (MAX_NUMNODES * 4)
# define NR_NODE_MEMBLKS (NR_NODES * 4)
#endif #endif
#else /* CONFIG_DISCONTIGMEM */ #else /* CONFIG_DISCONTIGMEM */
# define NR_NODE_MEMBLKS 4 # define NR_NODE_MEMBLKS (MAX_NUMNODES * 4)
#endif /* CONFIG_DISCONTIGMEM */ #endif /* CONFIG_DISCONTIGMEM */
#endif /* _ASM_IA64_MMZONE_H */ #endif /* _ASM_IA64_MMZONE_H */
...@@ -27,7 +27,7 @@ struct pglist_data; ...@@ -27,7 +27,7 @@ struct pglist_data;
struct ia64_node_data { struct ia64_node_data {
short active_cpu_count; short active_cpu_count;
short node; short node;
struct pglist_data *pg_data_ptrs[NR_NODES]; struct pglist_data *pg_data_ptrs[MAX_NUMNODES];
}; };
......
...@@ -59,7 +59,7 @@ extern struct node_cpuid_s node_cpuid[NR_CPUS]; ...@@ -59,7 +59,7 @@ extern struct node_cpuid_s node_cpuid[NR_CPUS];
*/ */
extern u8 numa_slit[MAX_NUMNODES * MAX_NUMNODES]; extern u8 numa_slit[MAX_NUMNODES * MAX_NUMNODES];
#define node_distance(from,to) (numa_slit[(from) * numnodes + (to)]) #define node_distance(from,to) (numa_slit[(from) * num_online_nodes() + (to)])
extern int paddr_to_nid(unsigned long paddr); extern int paddr_to_nid(unsigned long paddr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment