From 683e9c12192d57dbcf5f09b481ac3a7c9fe927e0 Mon Sep 17 00:00:00 2001 From: Yinghai Lu Date: Sun, 1 Jun 2008 21:06:31 -0700 Subject: [PATCH] --- yaml --- r: 99725 b: refs/heads/master c: 287572cb38de7f270b59191a0fecfa5c5de7765d h: refs/heads/master i: 99723: 0093a6360ddeafaf11d4f6e8fb9a639fd8ddbf0b v: v3 --- [refs] | 2 +- trunk/arch/x86/mm/discontig_32.c | 27 ++++++++------------------- 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/[refs] b/[refs] index 7a42cf3f8b6c..b5e1b90deddc 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2944e16b25e7fb8b5ee0dd9dc7197a0f9e523cfd +refs/heads/master: 287572cb38de7f270b59191a0fecfa5c5de7765d diff --git a/trunk/arch/x86/mm/discontig_32.c b/trunk/arch/x86/mm/discontig_32.c index 3150ad385672..73a983489c60 100644 --- a/trunk/arch/x86/mm/discontig_32.c +++ b/trunk/arch/x86/mm/discontig_32.c @@ -38,6 +38,7 @@ #include #include #include +#include struct pglist_data *node_data[MAX_NUMNODES] __read_mostly; EXPORT_SYMBOL(node_data); @@ -326,7 +327,6 @@ unsigned long __init setup_memory(void) { int nid; unsigned long system_start_pfn, system_max_low_pfn; - unsigned long wasted_pages; /* * When mapping a NUMA machine we allocate the node_mem_map arrays @@ -337,29 +337,18 @@ unsigned long __init setup_memory(void) */ get_memcfg_numa(); - kva_pages = calculate_numa_remap_pages(); + kva_pages = round_up(calculate_numa_remap_pages(), PTRS_PER_PTE); /* partially used pages are not usable - thus round upwards */ system_start_pfn = min_low_pfn = PFN_UP(init_pg_tables_end); - kva_start_pfn = find_max_low_pfn() - kva_pages; - -#ifdef CONFIG_BLK_DEV_INITRD - /* Numa kva area is below the initrd */ - if (initrd_start) - kva_start_pfn = PFN_DOWN(initrd_start - PAGE_OFFSET) - - kva_pages; -#endif - - /* - * We waste pages past at the end of the KVA for no good reason other - * than how it is located. This is bad. - */ - wasted_pages = kva_start_pfn & (PTRS_PER_PTE-1); - kva_start_pfn -= wasted_pages; - kva_pages += wasted_pages; - system_max_low_pfn = max_low_pfn = find_max_low_pfn(); + kva_start_pfn = round_down(max_low_pfn - kva_pages, PTRS_PER_PTE); + kva_start_pfn = find_e820_area(kva_start_pfn<> PAGE_SHIFT; + printk("kva_start_pfn ~ %ld find_max_low_pfn() ~ %ld\n", kva_start_pfn, max_low_pfn); printk("max_pfn = %ld\n", max_pfn);