diff options
author | Tejun Heo <tj@kernel.org> | 2009-03-01 02:06:56 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2009-03-01 02:06:56 -0500 |
commit | d0c4f570276cb4d2dc4215b90eb7cb6e2bdd4a15 (patch) | |
tree | 5cf4f85082ed720df7d815299782e25e44d75c9d /arch/x86/include | |
parent | af6326d72c95d6e0bbc88c92185c654f57acef3b (diff) |
bootmem, x86: further fixes for arch-specific bootmem wrapping
Impact: fix new breakages introduced by previous fix
Commit c132937556f56ee4b831ef4b23f1846e05fde102 tried to clean up
bootmem arch wrapper but it wasn't quite correct. Before the commit,
the followings were broken.
* Low level interface functions prefixed with __ ignored arch
preference.
* reserve_bootmem(...) can't be mapped into
reserve_bootmem_node(NODE_DATA(0)->bdata, ...) because the node is
not preference here. The region specified MUST fall into the
specified region; otherwise, it will panic.
After the commit,
* If allocation fails for the arch preferred node, it should fallback
to whatever is available. Instead, it simply failed allocation.
There are too many internal details to allow generic wrapping and
still keep things simple for archs. Plus, all that arch wants is a
way to prefer certain node over another.
This patch drops the generic wrapping around alloc_bootmem_core() and
add alloc_bootmem_core() instead. If necessary, arch can define
bootmem_arch_referred_node() macro or function which takes all
allocation information and returns the preferred node. bootmem
generic code will always try the preferred node first and then
fallback to other nodes as usual.
Breakages noted and changes reviewed by Johannes Weiner.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Diffstat (limited to 'arch/x86/include')
-rw-r--r-- | arch/x86/include/asm/mmzone_32.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/x86/include/asm/mmzone_32.h b/arch/x86/include/asm/mmzone_32.h index eeacf67de49e..ede6998bd92c 100644 --- a/arch/x86/include/asm/mmzone_32.h +++ b/arch/x86/include/asm/mmzone_32.h | |||
@@ -92,12 +92,8 @@ static inline int pfn_valid(int pfn) | |||
92 | 92 | ||
93 | #ifdef CONFIG_NEED_MULTIPLE_NODES | 93 | #ifdef CONFIG_NEED_MULTIPLE_NODES |
94 | /* always use node 0 for bootmem on this numa platform */ | 94 | /* always use node 0 for bootmem on this numa platform */ |
95 | #define alloc_bootmem_core(__bdata, size, align, goal, limit) \ | 95 | #define bootmem_arch_preferred_node(__bdata, size, align, goal, limit) \ |
96 | ({ \ | 96 | (NODE_DATA(0)->bdata) |
97 | bootmem_data_t __maybe_unused * __abm_bdata_dummy = (__bdata); \ | ||
98 | __alloc_bootmem_core(NODE_DATA(0)->bdata, \ | ||
99 | (size), (align), (goal), (limit)); \ | ||
100 | }) | ||
101 | #endif /* CONFIG_NEED_MULTIPLE_NODES */ | 97 | #endif /* CONFIG_NEED_MULTIPLE_NODES */ |
102 | 98 | ||
103 | #endif /* _ASM_X86_MMZONE_32_H */ | 99 | #endif /* _ASM_X86_MMZONE_32_H */ |