diff options
author | Tang Chen <tangchen@cn.fujitsu.com> | 2013-02-22 19:33:37 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-23 20:50:14 -0500 |
commit | 34b71f1e04fcba578e719e675b4882eeeb2a1f6f (patch) | |
tree | beafbed8dce82b108e95baa2c2424ee0f3e94701 /include | |
parent | 4d59a75125d5a4717e57e9fc62c64b3d346e603e (diff) |
page_alloc: add movable_memmap kernel parameter
Add functions to parse movablemem_map boot option. Since the option
could be specified more then once, all the maps will be stored in the
global variable movablemem_map.map array.
And also, we keep the array in monotonic increasing order by start_pfn.
And merge all overlapped ranges.
[akpm@linux-foundation.org: improve comment]
[akpm@linux-foundation.org: checkpatch fixes]
[akpm@linux-foundation.org: remove unneeded parens]
Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Reviewed-by: Wen Congyang <wency@cn.fujitsu.com>
Tested-by: Lin Feng <linfeng@cn.fujitsu.com>
Cc: Wu Jianguo <wujianguo@huawei.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mm.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index 9d659491c0ae..ce9bd3049836 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -1359,6 +1359,17 @@ extern void free_bootmem_with_active_regions(int nid, | |||
1359 | unsigned long max_low_pfn); | 1359 | unsigned long max_low_pfn); |
1360 | extern void sparse_memory_present_with_active_regions(int nid); | 1360 | extern void sparse_memory_present_with_active_regions(int nid); |
1361 | 1361 | ||
1362 | #define MOVABLEMEM_MAP_MAX MAX_NUMNODES | ||
1363 | struct movablemem_entry { | ||
1364 | unsigned long start_pfn; /* start pfn of memory segment */ | ||
1365 | unsigned long end_pfn; /* end pfn of memory segment (exclusive) */ | ||
1366 | }; | ||
1367 | |||
1368 | struct movablemem_map { | ||
1369 | int nr_map; | ||
1370 | struct movablemem_entry map[MOVABLEMEM_MAP_MAX]; | ||
1371 | }; | ||
1372 | |||
1362 | #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ | 1373 | #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ |
1363 | 1374 | ||
1364 | #if !defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) && \ | 1375 | #if !defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) && \ |