diff options
author | Philipp Hachtmann <phacht@linux.vnet.ibm.com> | 2014-01-29 12:16:01 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2014-05-20 02:58:39 -0400 |
commit | 70210ed950b538ee7eb811dccc402db9df1c9be4 (patch) | |
tree | 8f924bff7152d8528be40c1995a8330b6a5ac70d /mm | |
parent | f1af9d3af308145478749194346f11efad1134b2 (diff) |
mm/memblock: add physical memory list
Add the physmem list to the memblock structure. This list only exists
if HAVE_MEMBLOCK_PHYS_MAP is selected and contains the unmodified
list of physically available memory. It differs from the memblock
memory list as it always contains all memory ranges even if the
memory has been restricted, e.g. by use of the mem= kernel parameter.
Signed-off-by: Philipp Hachtmann <phacht@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/Kconfig | 3 | ||||
-rw-r--r-- | mm/memblock.c | 12 |
2 files changed, 15 insertions, 0 deletions
diff --git a/mm/Kconfig b/mm/Kconfig index 1b5a95f0fa01..28cec518f4d4 100644 --- a/mm/Kconfig +++ b/mm/Kconfig | |||
@@ -134,6 +134,9 @@ config HAVE_MEMBLOCK | |||
134 | config HAVE_MEMBLOCK_NODE_MAP | 134 | config HAVE_MEMBLOCK_NODE_MAP |
135 | boolean | 135 | boolean |
136 | 136 | ||
137 | config HAVE_MEMBLOCK_PHYS_MAP | ||
138 | boolean | ||
139 | |||
137 | config ARCH_DISCARD_MEMBLOCK | 140 | config ARCH_DISCARD_MEMBLOCK |
138 | boolean | 141 | boolean |
139 | 142 | ||
diff --git a/mm/memblock.c b/mm/memblock.c index 9edd0928daab..a810ba923cdd 100644 --- a/mm/memblock.c +++ b/mm/memblock.c | |||
@@ -27,6 +27,9 @@ | |||
27 | 27 | ||
28 | static struct memblock_region memblock_memory_init_regions[INIT_MEMBLOCK_REGIONS] __initdata_memblock; | 28 | static struct memblock_region memblock_memory_init_regions[INIT_MEMBLOCK_REGIONS] __initdata_memblock; |
29 | static struct memblock_region memblock_reserved_init_regions[INIT_MEMBLOCK_REGIONS] __initdata_memblock; | 29 | static struct memblock_region memblock_reserved_init_regions[INIT_MEMBLOCK_REGIONS] __initdata_memblock; |
30 | #ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP | ||
31 | static struct memblock_region memblock_physmem_init_regions[INIT_PHYSMEM_REGIONS] __initdata_memblock; | ||
32 | #endif | ||
30 | 33 | ||
31 | struct memblock memblock __initdata_memblock = { | 34 | struct memblock memblock __initdata_memblock = { |
32 | .memory.regions = memblock_memory_init_regions, | 35 | .memory.regions = memblock_memory_init_regions, |
@@ -37,6 +40,12 @@ struct memblock memblock __initdata_memblock = { | |||
37 | .reserved.cnt = 1, /* empty dummy entry */ | 40 | .reserved.cnt = 1, /* empty dummy entry */ |
38 | .reserved.max = INIT_MEMBLOCK_REGIONS, | 41 | .reserved.max = INIT_MEMBLOCK_REGIONS, |
39 | 42 | ||
43 | #ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP | ||
44 | .physmem.regions = memblock_physmem_init_regions, | ||
45 | .physmem.cnt = 1, /* empty dummy entry */ | ||
46 | .physmem.max = INIT_PHYSMEM_REGIONS, | ||
47 | #endif | ||
48 | |||
40 | .bottom_up = false, | 49 | .bottom_up = false, |
41 | .current_limit = MEMBLOCK_ALLOC_ANYWHERE, | 50 | .current_limit = MEMBLOCK_ALLOC_ANYWHERE, |
42 | }; | 51 | }; |
@@ -1553,6 +1562,9 @@ static int __init memblock_init_debugfs(void) | |||
1553 | return -ENXIO; | 1562 | return -ENXIO; |
1554 | debugfs_create_file("memory", S_IRUGO, root, &memblock.memory, &memblock_debug_fops); | 1563 | debugfs_create_file("memory", S_IRUGO, root, &memblock.memory, &memblock_debug_fops); |
1555 | debugfs_create_file("reserved", S_IRUGO, root, &memblock.reserved, &memblock_debug_fops); | 1564 | debugfs_create_file("reserved", S_IRUGO, root, &memblock.reserved, &memblock_debug_fops); |
1565 | #ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP | ||
1566 | debugfs_create_file("physmem", S_IRUGO, root, &memblock.physmem, &memblock_debug_fops); | ||
1567 | #endif | ||
1556 | 1568 | ||
1557 | return 0; | 1569 | return 0; |
1558 | } | 1570 | } |