aboutsummaryrefslogtreecommitdiffstats
path: root/mm/nobootmem.c
diff options
context:
space:
mode:
authorGrygorii Strashko <grygorii.strashko@ti.com>2014-01-21 18:50:16 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-21 19:19:46 -0500
commitb115423357e0cda6d8f45d0c81df537d7b004020 (patch)
treef3acecb4396cd1967ae57d71269a84862d9a10ad /mm/nobootmem.c
parent87029ee9390b2297dae699d5fb135b77992116e5 (diff)
mm/memblock: switch to use NUMA_NO_NODE instead of MAX_NUMNODES
It's recommended to use NUMA_NO_NODE everywhere to select "process any node" behavior or to indicate that "no node id specified". Hence, update __next_free_mem_range*() API's to accept both NUMA_NO_NODE and MAX_NUMNODES, but emit warning once on MAX_NUMNODES, and correct corresponding API's documentation to describe new behavior. Also, update other memblock/nobootmem APIs where MAX_NUMNODES is used dirrectly. The change was suggested by Tejun Heo. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Tejun Heo <tj@kernel.org> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Christoph Lameter <cl@linux-foundation.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Michal Hocko <mhocko@suse.cz> Cc: Paul Walmsley <paul@pwsan.com> Cc: Pavel Machek <pavel@ucw.cz> Cc: Russell King <linux@arm.linux.org.uk> Cc: Tony Lindgren <tony@atomide.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/nobootmem.c')
-rw-r--r--mm/nobootmem.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/nobootmem.c b/mm/nobootmem.c
index 59777e050d09..19121ceb8874 100644
--- a/mm/nobootmem.c
+++ b/mm/nobootmem.c
@@ -117,7 +117,7 @@ static unsigned long __init free_low_memory_core_early(void)
117 phys_addr_t start, end, size; 117 phys_addr_t start, end, size;
118 u64 i; 118 u64 i;
119 119
120 for_each_free_mem_range(i, MAX_NUMNODES, &start, &end, NULL) 120 for_each_free_mem_range(i, NUMA_NO_NODE, &start, &end, NULL)
121 count += __free_memory_core(start, end); 121 count += __free_memory_core(start, end);
122 122
123 /* free range that is used for reserved array if we allocate it */ 123 /* free range that is used for reserved array if we allocate it */
@@ -161,7 +161,7 @@ unsigned long __init free_all_bootmem(void)
161 reset_all_zones_managed_pages(); 161 reset_all_zones_managed_pages();
162 162
163 /* 163 /*
164 * We need to use MAX_NUMNODES instead of NODE_DATA(0)->node_id 164 * We need to use NUMA_NO_NODE instead of NODE_DATA(0)->node_id
165 * because in some case like Node0 doesn't have RAM installed 165 * because in some case like Node0 doesn't have RAM installed
166 * low ram will be on Node1 166 * low ram will be on Node1
167 */ 167 */
@@ -215,7 +215,7 @@ static void * __init ___alloc_bootmem_nopanic(unsigned long size,
215 215
216restart: 216restart:
217 217
218 ptr = __alloc_memory_core_early(MAX_NUMNODES, size, align, goal, limit); 218 ptr = __alloc_memory_core_early(NUMA_NO_NODE, size, align, goal, limit);
219 219
220 if (ptr) 220 if (ptr)
221 return ptr; 221 return ptr;
@@ -299,7 +299,7 @@ again:
299 if (ptr) 299 if (ptr)
300 return ptr; 300 return ptr;
301 301
302 ptr = __alloc_memory_core_early(MAX_NUMNODES, size, align, 302 ptr = __alloc_memory_core_early(NUMA_NO_NODE, size, align,
303 goal, limit); 303 goal, limit);
304 if (ptr) 304 if (ptr)
305 return ptr; 305 return ptr;