X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fi386%2Fmm%2Fdiscontig.c;h=2b535d2c97daccdefc7d0761630f06de94e22458;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=efdcb0da9ffd660933f6351032d885760bf344a4;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/arch/i386/mm/discontig.c b/arch/i386/mm/discontig.c index efdcb0da9..2b535d2c9 100644 --- a/arch/i386/mm/discontig.c +++ b/arch/i386/mm/discontig.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -40,7 +41,7 @@ bootmem_data_t node0_bdata; * numa interface - we expect the numa architecture specfic code to have * populated the following initialisation. * - * 1) numnodes - the total number of nodes configured in the system + * 1) node_online_map - the map of all nodes configured (online) in the system * 2) physnode_map - the mapping between a pfn and owning node * 3) node_start_pfn - the starting page frame number for a node * 3) node_end_pfn - the ending page fram number for a node @@ -92,12 +93,12 @@ int __init get_memcfg_numa_flat(void) /* Run the memory configuration and find the top of memory. */ find_max_pfn(); - node_start_pfn[0] = 0; - node_end_pfn[0] = max_pfn; + node_start_pfn[0] = 0; + node_end_pfn[0] = max_pfn; /* Indicate there is one node available. */ + nodes_clear(node_online_map); node_set_online(0); - numnodes = 1; return 1; } @@ -182,7 +183,9 @@ void __init remap_numa_kva(void) unsigned long pfn; int node; - for (node = 1; node < numnodes; ++node) { + for_each_online_node(node) { + if (node == 0) + continue; for (pfn=0; pfn < node_remap_size[node]; pfn += PTRS_PER_PTE) { vaddr = node_remap_start_vaddr[node]+(pfn<bdata = &node0_bdata; @@ -374,14 +379,16 @@ void __init zone_sizes_init(void) * Clobber node 0's links and NULL out pgdat_list before starting. */ pgdat_list = NULL; - for (nid = numnodes - 1; nid >= 0; nid--) { + for (nid = MAX_NUMNODES - 1; nid >= 0; nid--) { + if (!node_online(nid)) + continue; if (nid) memset(NODE_DATA(nid), 0, sizeof(pg_data_t)); NODE_DATA(nid)->pgdat_next = pgdat_list; pgdat_list = NODE_DATA(nid); } - for (nid = 0; nid < numnodes; nid++) { + for_each_online_node(nid) { unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0}; unsigned long *zholes_size; unsigned int max_dma; @@ -463,11 +470,6 @@ void __init set_highmem_pages_init(int bad_ppro) void __init set_max_mapnr_init(void) { #ifdef CONFIG_HIGHMEM - struct zone *high0 = &NODE_DATA(0)->node_zones[ZONE_HIGHMEM]; - if (high0->spanned_pages > 0) - highmem_start_page = high0->zone_mem_map; - else - highmem_start_page = pfn_to_page(max_low_pfn+1); num_physpages = highend_pfn; #else num_physpages = max_low_pfn;