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 /mm/nobootmem.c | |
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 'mm/nobootmem.c')
-rw-r--r-- | mm/nobootmem.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/nobootmem.c b/mm/nobootmem.c index c78162668bc4..2037a8a04761 100644 --- a/mm/nobootmem.c +++ b/mm/nobootmem.c | |||
@@ -106,7 +106,7 @@ static void __init __free_pages_memory(unsigned long start, unsigned long end) | |||
106 | __free_pages_bootmem(pfn_to_page(i), 0); | 106 | __free_pages_bootmem(pfn_to_page(i), 0); |
107 | } | 107 | } |
108 | 108 | ||
109 | unsigned long __init free_all_memory_core_early(int nodeid) | 109 | unsigned long __init free_low_memory_core_early(int nodeid) |
110 | { | 110 | { |
111 | int i; | 111 | int i; |
112 | u64 start, end; | 112 | u64 start, end; |
@@ -114,7 +114,7 @@ unsigned long __init free_all_memory_core_early(int nodeid) | |||
114 | struct range *range = NULL; | 114 | struct range *range = NULL; |
115 | int nr_range; | 115 | int nr_range; |
116 | 116 | ||
117 | nr_range = get_free_all_memory_range(&range, nodeid); | 117 | nr_range = __get_free_all_memory_range(&range, nodeid, 0, max_low_pfn); |
118 | 118 | ||
119 | for (i = 0; i < nr_range; i++) { | 119 | for (i = 0; i < nr_range; i++) { |
120 | start = range[i].start; | 120 | start = range[i].start; |
@@ -136,7 +136,7 @@ unsigned long __init free_all_bootmem_node(pg_data_t *pgdat) | |||
136 | { | 136 | { |
137 | register_page_bootmem_info_node(pgdat); | 137 | register_page_bootmem_info_node(pgdat); |
138 | 138 | ||
139 | /* free_all_memory_core_early(MAX_NUMNODES) will be called later */ | 139 | /* free_low_memory_core_early(MAX_NUMNODES) will be called later */ |
140 | return 0; | 140 | return 0; |
141 | } | 141 | } |
142 | 142 | ||
@@ -154,7 +154,7 @@ unsigned long __init free_all_bootmem(void) | |||
154 | * Use MAX_NUMNODES will make sure all ranges in early_node_map[] | 154 | * Use MAX_NUMNODES will make sure all ranges in early_node_map[] |
155 | * will be used instead of only Node0 related | 155 | * will be used instead of only Node0 related |
156 | */ | 156 | */ |
157 | return free_all_memory_core_early(MAX_NUMNODES); | 157 | return free_low_memory_core_early(MAX_NUMNODES); |
158 | } | 158 | } |
159 | 159 | ||
160 | /** | 160 | /** |