x86_64: make reserve_bootmem_generic() use new reserve_bootmem()

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git-commits-head@...>
Date: Saturday, April 26, 2008 - 6:01 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8b3cd0...
Commit:     8b3cd09ed23049fcb02479c6286744b36324ac9d
Parent:     a5645a61b3b7e7d7de15e1a642ead600150ce94d
Author:     Yinghai Lu <yhlu.kernel@gmail.com>
AuthorDate: Tue Mar 18 12:50:21 2008 -0700
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Sat Apr 26 22:51:08 2008 +0200

    x86_64: make reserve_bootmem_generic() use new reserve_bootmem()
    
    "mm: make reserve_bootmem can crossed the nodes" provides new
    reserve_bootmem(), let reserve_bootmem_generic() use that.
    
    reserve_bootmem_generic() is used to reserve initramdisk, so this way
    we can make sure even when bootloader or kexec load ranges cross the
    node memory boundaries, reserve_bootmem still works.
    
    Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/mm/init_64.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 0cca626..7dc4fbc 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -810,7 +810,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
 void __init reserve_bootmem_generic(unsigned long phys, unsigned len)
 {
 #ifdef CONFIG_NUMA
-	int nid = phys_to_nid(phys);
+	int nid, next_nid;
 #endif
 	unsigned long pfn = phys >> PAGE_SHIFT;
 
@@ -829,10 +829,16 @@ void __init reserve_bootmem_generic(unsigned long phys, unsigned len)
 
 	/* Should check here against the e820 map to avoid double free */
 #ifdef CONFIG_NUMA
-	reserve_bootmem_node(NODE_DATA(nid), phys, len, BOOTMEM_DEFAULT);
+	nid = phys_to_nid(phys);
+	next_nid = phys_to_nid(phys + len - 1);
+	if (nid == next_nid)
+		reserve_bootmem_node(NODE_DATA(nid), phys, len, BOOTMEM_DEFAULT);
+	else
+		reserve_bootmem(phys, len, BOOTMEM_DEFAULT);
 #else
 	reserve_bootmem(phys, len, BOOTMEM_DEFAULT);
 #endif
+
 	if (phys+len <= MAX_DMA_PFN*PAGE_SIZE) {
 		dma_reserve += len / PAGE_SIZE;
 		set_dma_reserve(dma_reserve);
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
x86_64: make reserve_bootmem_generic() use new reserve_bootm..., Linux Kernel Mailing List..., (Sat Apr 26, 6:01 pm)