* [PATCH] x86_64: make reserve_bootmem_generic to use new reserve_bootmem
@ 2008-03-13 23:52 Yinghai Lu
0 siblings, 0 replies; only message in thread
From: Yinghai Lu @ 2008-03-13 23:52 UTC (permalink / raw)
To: Andrew Morton, Ingo Molnar, Thomas Gleixner, H. Peter Anvin
Cc: Andi Kleen, Christoph Lameter, kernel list
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: numa_64_use_new_reserve_bootmem.patch --]
[-- Type: text/x-patch; name=numa_64_use_new_reserve_bootmem.patch, Size: 1402 bytes --]
[PATCH] x86_64: make reserve_bootmem_generic to use new reserve_bootmem
[PATCH] mm: make reserve_bootmem can crossed the nodes
provides new resever_bootmem, let reserve_bootmem_generic use that.
acctualy reserve_bootme_generic is used to reserve initramdisk.
so we can make sure even bootloader or kexec load that cross the nodes, reserve_bootmem
still works.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Index: linux-2.6/arch/x86/mm/init_64.c
===================================================================
--- linux-2.6.orig/arch/x86/mm/init_64.c
+++ linux-2.6/arch/x86/mm/init_64.c
@@ -688,7 +688,7 @@ void free_initrd_mem(unsigned long start
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;
@@ -707,10 +707,14 @@ void __init reserve_bootmem_generic(unsi
/* Should check here against the e820 map to avoid double free */
#ifdef CONFIG_NUMA
+ 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
#endif
+ reserve_bootmem(phys, len, BOOTMEM_DEFAULT);
+
if (phys+len <= MAX_DMA_PFN*PAGE_SIZE) {
dma_reserve += len / PAGE_SIZE;
set_dma_reserve(dma_reserve);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-03-13 23:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-13 23:52 [PATCH] x86_64: make reserve_bootmem_generic to use new reserve_bootmem Yinghai Lu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®