diff options
author | Tejun Heo <tj@kernel.org> | 2011-07-12 05:16:01 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2011-07-14 14:47:49 -0400 |
commit | 64a02daacbc880bac1d6b3aeefbcd226a9341fa7 (patch) | |
tree | d87b71baee631aaeb7b34b53ed24f716ad06f056 /arch/x86/mm | |
parent | 8d89ac808417e92a33fb5fa3c86352016643775a (diff) |
memblock, x86: Make free_all_memory_core_early() explicitly free lowmem only
nomemblock is currently used only by x86 and on x86_32
free_all_memory_core_early() silently freed only the low mem because
get_free_all_memory_range() in arch/x86/mm/memblock.c implicitly
limited range to max_low_pfn.
Rename free_all_memory_core_early() to free_low_memory_core_early()
and make it call __get_free_all_memory_range() and limit the range to
max_low_pfn explicitly. This makes things clearer and also is
consistent with the bootmem behavior.
This leaves get_free_all_memory_range() without any user. Kill it.
Signed-off-by: Tejun Heo <tj@kernel.org>
Link: http://lkml.kernel.org/r/1310462166-31469-9-git-send-email-tj@kernel.org
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/mm')
-rw-r--r-- | arch/x86/mm/memblock.c | 10 | ||||
-rw-r--r-- | arch/x86/mm/numa_64.c | 2 |
2 files changed, 1 insertions, 11 deletions
diff --git a/arch/x86/mm/memblock.c b/arch/x86/mm/memblock.c index 648d47d52a86..0e8442a9baff 100644 --- a/arch/x86/mm/memblock.c +++ b/arch/x86/mm/memblock.c | |||
@@ -89,16 +89,6 @@ int __init __get_free_all_memory_range(struct range **rangep, int nodeid, | |||
89 | return nr_range; | 89 | return nr_range; |
90 | } | 90 | } |
91 | 91 | ||
92 | int __init get_free_all_memory_range(struct range **rangep, int nodeid) | ||
93 | { | ||
94 | unsigned long end_pfn = -1UL; | ||
95 | |||
96 | #ifdef CONFIG_X86_32 | ||
97 | end_pfn = max_low_pfn; | ||
98 | #endif | ||
99 | return __get_free_all_memory_range(rangep, nodeid, 0, end_pfn); | ||
100 | } | ||
101 | |||
102 | static u64 __init __memblock_x86_memory_in_range(u64 addr, u64 limit, bool get_free) | 92 | static u64 __init __memblock_x86_memory_in_range(u64 addr, u64 limit, bool get_free) |
103 | { | 93 | { |
104 | int i, count; | 94 | int i, count; |
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c index dd27f401f0a0..92e27119ee1a 100644 --- a/arch/x86/mm/numa_64.c +++ b/arch/x86/mm/numa_64.c | |||
@@ -19,7 +19,7 @@ unsigned long __init numa_free_all_bootmem(void) | |||
19 | for_each_online_node(i) | 19 | for_each_online_node(i) |
20 | pages += free_all_bootmem_node(NODE_DATA(i)); | 20 | pages += free_all_bootmem_node(NODE_DATA(i)); |
21 | 21 | ||
22 | pages += free_all_memory_core_early(MAX_NUMNODES); | 22 | pages += free_low_memory_core_early(MAX_NUMNODES); |
23 | 23 | ||
24 | return pages; | 24 | return pages; |
25 | } | 25 | } |