From f799d3f91ddc8a09eecaaba5b6968b7fa3027639 Mon Sep 17 00:00:00 2001 From: MartinZhang Date: Sun, 5 Aug 2012 17:48:07 +0800 Subject: [PATCH 1/4] CONFIG_HIGHMEM and WANT_PAGE_VIRTUAL are not defined for x86_64 Signed-off-by: MartinZhang --- include/linux/mm.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 311be906b57d84..2a45586bf954f8 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -741,6 +741,7 @@ static __always_inline void *lowmem_page_address(const struct page *page) return __va(PFN_PHYS(page_to_pfn(page))); } +/*[x86_64][mm] CONFIG_HIGHMEM and WANT_PAGE_VIRTUAL is NOT defined for X86_64*/ #if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL) #define HASHED_PAGE_VIRTUAL #endif @@ -760,6 +761,7 @@ void set_page_address(struct page *page, void *virtual); void page_address_init(void); #endif +/*[x86_64][mm] X86_64 uses this branch. */ #if !defined(HASHED_PAGE_VIRTUAL) && !defined(WANT_PAGE_VIRTUAL) #define page_address(page) lowmem_page_address(page) #define set_page_address(page, address) do { } while(0) From 155fb4877e72fb6d5f3528fe2a35892581bac22d Mon Sep 17 00:00:00 2001 From: MartinZhang Date: Sat, 11 Aug 2012 13:25:48 +0800 Subject: [PATCH 2/4] let end_pfn align with 1< --- arch/x86/mm/init.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index ab1f6a93b527c9..e9548136d0fce1 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c @@ -183,6 +183,7 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, end_pfn = ((pos + (PMD_SIZE - 1))>>PMD_SHIFT) << (PMD_SHIFT - PAGE_SHIFT); #else /* CONFIG_X86_64 */ + /*[x86_64][mm]] let end_pfn align with 1<> PMD_SHIFT) << (PMD_SHIFT - PAGE_SHIFT); #endif From 2f6215c3a7b24660af0b326e6866f2f43e30244d Mon Sep 17 00:00:00 2001 From: MartinZhang Date: Sun, 12 Aug 2012 17:48:12 +0800 Subject: [PATCH 3/4] 4G will be use as the boarder for X86_64 low/high memory Signed-off-by: MartinZhang --- arch/x86/kernel/setup.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index f4b9b80e1b95e2..2cb6887f493b06 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -873,6 +873,9 @@ void __init setup_arch(char **cmdline_p) high_memory = (void *)__va(max_pfn * PAGE_SIZE - 1) + 1; #endif + /*[x86_64] [mm] [Junwei]: x86 will split the memeory map(from e820) by 4G(1<<32)*/ + printk(KERN_INFO "%s: max_pfn=%lu(%lx), max_low_pfn=%lu(%lx), highmem=%p\n", + __func__, max_pfn, max_pfn, max_low_pfn, max_low_pfn, high_memory); /* * Find and reserve possible boot-time SMP configuration: */ From 131a80b81d4da2af6b5cad2221d6219ccb7378ac Mon Sep 17 00:00:00 2001 From: Junwei Zhang Date: Mon, 1 Oct 2012 05:42:06 +0800 Subject: [PATCH 4/4] temp save PR= Acked-by: Signed-off-by: Junwei Zhang --- arch/x86/kernel/setup_percpu.c | 1 + linux.mk | 2 ++ mm/vmalloc.c | 7 +++++++ 3 files changed, 10 insertions(+) create mode 100644 linux.mk diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c index 5cdff035774656..3668140bc201ad 100644 --- a/arch/x86/kernel/setup_percpu.c +++ b/arch/x86/kernel/setup_percpu.c @@ -183,6 +183,7 @@ void __init setup_per_cpu_areas(void) if (pcpu_chosen_fc == PCPU_FC_AUTO && pcpu_need_numa()) pcpu_chosen_fc = PCPU_FC_PAGE; #endif + printk(KERN_INFO "%s: pcpu_chosen_fc=%d\n", __FUNCTION__, pcpu_chosen_fc); rc = -EINVAL; if (pcpu_chosen_fc != PCPU_FC_PAGE) { const size_t dyn_size = PERCPU_MODULE_RESERVE + diff --git a/linux.mk b/linux.mk new file mode 100644 index 00000000000000..3d7bb2e209ca9b --- /dev/null +++ b/linux.mk @@ -0,0 +1,2 @@ +all: + make J=2 diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 2bb90b1d241cc8..86985740def62c 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -2356,6 +2356,13 @@ struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets, unsigned long base, start, end, last_end; bool purged = false; + { + int i; + for (i=0; i