On Thu, Nov 15, 2007 at 01:29:19PM +0900, KAMEZAWA Hiroyuki wrote:Hi KAMEZAWA, Thanks for the patch, it resolves memory_add_physaddr_to_nid() build error for me. Tested-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> arch/x86/mm/init_64.c | 2 +- arch/x86/mm/srat_64.c | 1 + mm/sparse-vmemmap.c | 13 ++++++++++++- mm/sparse.c | 12 ++++++++++-- 4 files changed, 24 insertions(+), 4 deletions(-) =================================================================== --- linux-2.6.24-rc2-mm1.orig/arch/x86/mm/srat_64.c +++ linux-2.6.24-rc2-mm1/arch/x86/mm/srat_64.c @@ -562,3 +562,4 @@ int memory_add_physaddr_to_nid(u64 start return ret; } +EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); Index: linux-2.6.24-rc2-mm1/arch/x86/mm/init_64.c =================================================================== --- linux-2.6.24-rc2-mm1.orig/arch/x86/mm/init_64.c +++ linux-2.6.24-rc2-mm1/arch/x86/mm/init_64.c @@ -319,7 +319,7 @@ static void __meminit phys_pud_init(pud_ __flush_tlb(); } -static void __init find_early_table_space(unsigned long end) +static void __init_refok find_early_table_space(unsigned long end) { unsigned long puds, pmds, tables, start; Index: linux-2.6.24-rc2-mm1/mm/sparse.c =================================================================== --- linux-2.6.24-rc2-mm1.orig/mm/sparse.c +++ linux-2.6.24-rc2-mm1/mm/sparse.c @@ -55,7 +55,15 @@ static inline void set_section_nid(unsig #endif #ifdef CONFIG_SPARSEMEM_EXTREME -static struct mem_section noinline __init_refok *sparse_index_alloc(int nid) +/* + * for avoiding section mismatch. + */ +static void __init_refok *__call_bootmem_alloc(int nid, int array_size) +{ + return alloc_bootmem_node(NODE_DATA(nid), array_size); +} + +static struct mem_section noinline __meminit *sparse_index_alloc(int nid) { struct mem_section *section = NULL; unsigned long array_size = SECTIONS_PER_ROOT * @@ -64,7 +72,7 @@ static struct mem_section noinline __ini if (slab_is_available()) section = kmalloc_node(array_size, GFP_KERNEL, nid); else - section = alloc_bootmem_node(NODE_DATA(nid), array_size); + section = __call_bootmem_alloc(nid, array_size); if (section) memset(section, 0, array_size); Index: linux-2.6.24-rc2-mm1/mm/sparse-vmemmap.c =================================================================== --- linux-2.6.24-rc2-mm1.orig/mm/sparse-vmemmap.c +++ linux-2.6.24-rc2-mm1/mm/sparse-vmemmap.c @@ -30,6 +30,17 @@ #include <asm/pgtable.h> /* + * wrapper for calling bootmem alloc from __meminit code. + */ +void __init_refok *__call_alloc_bootmem(int node, + int size, int align, int goal) +{ + return __alloc_bootmem_node(NODE_DATA(node), size, align, goal); +} + + + +/* * Allocate a block of memory to be used to back the virtual memory map * or to back the page tables that are used to create the mapping. * Uses the main allocators if they are available, else bootmem. @@ -44,7 +55,7 @@ void * __meminit vmemmap_alloc_block(uns return page_address(page); return NULL; } else - return __alloc_bootmem_node(NODE_DATA(node), size, size, + return __call_alloc_bootmem(node, size, size, __pa(MAX_DMA_ADDRESS)); } -
| Ingo Molnar | [patch 02/13] syslets: add syslet.h include file, user API/ABI definitions |
| Heiko Carstens | Re: 2.6.25-rc6-git6: Reported regressions from 2.6.24 |
| Greg Kroah-Hartman | [PATCH 010/196] Chinese: add translation of Codingstyle |
| Rafael J. Wysocki | [Bug #10629] 2.6.26-rc1-$sha1: RIP __d_lookup+0x8c/0x160 |
git: | |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
| Linus Torvalds | Re: [GIT]: Networking |
| Mark Lord | Re: [BUG] New Kernel Bugs |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
