Skip to content

Commit 0d036e9

Browse files
grygoriyStorvalds
authored andcommitted
mm/page_cgroup.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: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Santosh 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: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 8b89a11 commit 0d036e9

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎mm/page_cgroup.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ static int __init alloc_node_page_cgroup(int nid)
5454

5555
table_size = sizeof(struct page_cgroup) * nr_pages;
5656

57-
base = __alloc_bootmem_node_nopanic(NODE_DATA(nid),
58-
table_size, PAGE_SIZE, __pa(MAX_DMA_ADDRESS));
57+
base = memblock_virt_alloc_try_nid_nopanic(
58+
table_size, PAGE_SIZE, __pa(MAX_DMA_ADDRESS),
59+
BOOTMEM_ALLOC_ACCESSIBLE, nid);
5960
if (!base)
6061
return -ENOMEM;
6162
NODE_DATA(nid)->node_page_cgroup = base;

0 commit comments

Comments
 (0)