mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
[PATCH] sparsemem base: simple NUMA remap space allocator
Introduce a simple allocator for the NUMA remap space. This space is very scarce, used for structures which are best allocated node local. This mechanism is also used on non-NUMA ia64 systems with a vmem_map to keep the pgdat->node_mem_map initialized in a consistent place for all architectures. Issues: o alloc_remap takes a node_id where we might expect a pgdat which was intended to allow us to allocate the pgdat's using this mechanism; which we do not yet do. Could have alloc_remap_node() and alloc_remap_nid() for this purpose. Signed-off-by: Andy Whitcroft <[email protected]> Signed-off-by: Dave Hansen <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
c2ebaa425e
commit
6f167ec721
4 changed files with 50 additions and 29 deletions
|
|
@ -1936,6 +1936,7 @@ static void __init free_area_init_core(struct pglist_data *pgdat,
|
|||
static void __init alloc_node_mem_map(struct pglist_data *pgdat)
|
||||
{
|
||||
unsigned long size;
|
||||
struct page *map;
|
||||
|
||||
/* Skip empty nodes */
|
||||
if (!pgdat->node_spanned_pages)
|
||||
|
|
@ -1944,7 +1945,10 @@ static void __init alloc_node_mem_map(struct pglist_data *pgdat)
|
|||
/* ia64 gets its own node_mem_map, before this, without bootmem */
|
||||
if (!pgdat->node_mem_map) {
|
||||
size = (pgdat->node_spanned_pages + 1) * sizeof(struct page);
|
||||
pgdat->node_mem_map = alloc_bootmem_node(pgdat, size);
|
||||
map = alloc_remap(pgdat->node_id, size);
|
||||
if (!map)
|
||||
map = alloc_bootmem_node(pgdat, size);
|
||||
pgdat->node_mem_map = map;
|
||||
}
|
||||
#ifndef CONFIG_DISCONTIGMEM
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue