X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fmips%2Fsgi-ip27%2Fip27-klnuma.c;h=f9f404a8ddad625348975d4678ee4183b21de102;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=b5e86ad9867edbd59bbe8b58fcfccd4d60cab1ae;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/arch/mips/sgi-ip27/ip27-klnuma.c b/arch/mips/sgi-ip27/ip27-klnuma.c index b5e86ad98..f9f404a8d 100644 --- a/arch/mips/sgi-ip27/ip27-klnuma.c +++ b/arch/mips/sgi-ip27/ip27-klnuma.c @@ -3,10 +3,10 @@ * Copyright 2000 - 2001 Silicon Graphics, Inc. * Copyright 2000 - 2001 Kanoj Sarcar (kanoj@sgi.com) */ -#include #include #include #include +#include #include #include @@ -19,7 +19,6 @@ #include #include -extern char _end; static cpumask_t ktext_repmask; /* @@ -27,33 +26,25 @@ static cpumask_t ktext_repmask; * kernel. For example, we should never put a copy on a headless node, * and we should respect the topology of the machine. */ -void __init setup_replication_mask(int maxnodes) +void __init setup_replication_mask(void) { - static int numa_kernel_replication_ratio; cnodeid_t cnode; /* Set only the master cnode's bit. The master cnode is always 0. */ cpus_clear(ktext_repmask); cpu_set(0, ktext_repmask); - numa_kernel_replication_ratio = 0; #ifdef CONFIG_REPLICATE_KTEXT #ifndef CONFIG_MAPPED_KERNEL #error Kernel replication works with mapped kernel support. No calias support. #endif - numa_kernel_replication_ratio = 1; -#endif - - for (cnode = 1; cnode < numnodes; cnode++) { - /* See if this node should get a copy of the kernel */ - if (numa_kernel_replication_ratio && - !(cnode % numa_kernel_replication_ratio)) { - - /* Advertise that we have a copy of the kernel */ - cpu_set(cnode, ktext_repmask); - } + for_each_online_node(cnode) { + if (cnode == 0) + continue; + /* Advertise that we have a copy of the kernel */ + cpu_set(cnode, ktext_repmask); } - +#endif /* Set up a GDA pointer to the replication mask. */ GDA->g_ktext_repmask = &ktext_repmask; } @@ -61,12 +52,12 @@ void __init setup_replication_mask(int maxnodes) static __init void set_ktext_source(nasid_t client_nasid, nasid_t server_nasid) { - kern_vars_t *kvp; cnodeid_t client_cnode; + kern_vars_t *kvp; client_cnode = NASID_TO_COMPACT_NODEID(client_nasid); - kvp = &(HUB_DATA(client_nasid)->kern_vars); + kvp = &hub_data(client_nasid)->kern_vars; KERN_VARS_ADDR(client_nasid) = (unsigned long)kvp; @@ -92,7 +83,7 @@ static __init void copy_kernel(nasid_t dest_nasid) memcpy((void *)dest_kern_start, (void *)source_start, kern_size); } -void __init replicate_kernel_text(int maxnodes) +void __init replicate_kernel_text() { cnodeid_t cnode; nasid_t client_nasid; @@ -103,7 +94,9 @@ void __init replicate_kernel_text(int maxnodes) /* Record where the master node should get its kernel text */ set_ktext_source(master_nasid, master_nasid); - for (cnode = 1; cnode < maxnodes; cnode++) { + for_each_online_node(cnode) { + if (cnode == 0) + continue; client_nasid = COMPACT_TO_NASID_NODEID(cnode); /* Check if this node should get a copy of the kernel */ @@ -124,12 +117,12 @@ void __init replicate_kernel_text(int maxnodes) */ pfn_t node_getfirstfree(cnodeid_t cnode) { - unsigned long loadbase = CKSEG0; + unsigned long loadbase = REP_BASE; nasid_t nasid = COMPACT_TO_NASID_NODEID(cnode); unsigned long offset; #ifdef CONFIG_MAPPED_KERNEL - loadbase = CKSSEG + 16777216; + loadbase += 16777216; #endif offset = PAGE_ALIGN((unsigned long)(&_end)) - loadbase; if ((cnode == 0) || (cpu_isset(cnode, ktext_repmask)))