Commit c1529500 authored by Santosh Shilimkar's avatar Santosh Shilimkar Committed by Linus Torvalds

lib/cpumask.c: use memblock apis for early memory allocations

Switch to memblock interfaces for early memory allocator instead of
bootmem allocator.  No functional change in beahvior than what it is in
current code from bootmem users points of view.

Archs already converted to NO_BOOTMEM now directly use memblock
interfaces instead of bootmem wrappers build on top of memblock.  And
the archs which still uses bootmem, these new apis just fallback to
exiting bootmem APIs.
Signed-off-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
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: Grygorii Strashko <grygorii.strashko@ti.com>
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: Tejun Heo <tj@kernel.org>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 457ff1de
...@@ -140,7 +140,7 @@ EXPORT_SYMBOL(zalloc_cpumask_var); ...@@ -140,7 +140,7 @@ EXPORT_SYMBOL(zalloc_cpumask_var);
*/ */
void __init alloc_bootmem_cpumask_var(cpumask_var_t *mask) void __init alloc_bootmem_cpumask_var(cpumask_var_t *mask)
{ {
*mask = alloc_bootmem(cpumask_size()); *mask = memblock_virt_alloc(cpumask_size(), 0);
} }
/** /**
...@@ -161,6 +161,6 @@ EXPORT_SYMBOL(free_cpumask_var); ...@@ -161,6 +161,6 @@ EXPORT_SYMBOL(free_cpumask_var);
*/ */
void __init free_bootmem_cpumask_var(cpumask_var_t mask) void __init free_bootmem_cpumask_var(cpumask_var_t mask)
{ {
free_bootmem(__pa(mask), cpumask_size()); memblock_free_early(__pa(mask), cpumask_size());
} }
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment