summaryrefslogtreecommitdiffstats
path: root/mm/memblock.c
diff options
context:
space:
mode:
authorPhilipp Hachtmann <phacht@linux.vnet.ibm.com>2014-01-23 15:53:11 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 16:36:51 -0800
commit5e270e254885893f8c82ab9b91caa648af3690df (patch)
tree58b97739585bc97ba085a2b44fc256867c8a3f35 /mm/memblock.c
parent87379ec8c2b8ae0acd526b87d2240afca92a7505 (diff)
downloadop-kernel-dev-5e270e254885893f8c82ab9b91caa648af3690df.zip
op-kernel-dev-5e270e254885893f8c82ab9b91caa648af3690df.tar.gz
mm: free memblock.memory in free_all_bootmem
When calling free_all_bootmem() the free areas under memblock's control are released to the buddy allocator. Additionally the reserved list is freed if it was reallocated by memblock. The same should apply for the memory list. Signed-off-by: Philipp Hachtmann <phacht@linux.vnet.ibm.com> Reviewed-by: Tejun Heo <tj@kernel.org> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Tang Chen <tangchen@cn.fujitsu.com> Cc: Toshi Kani <toshi.kani@hp.com> Cc: Jianguo Wu <wujianguo@huawei.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>
Diffstat (limited to 'mm/memblock.c')
-rw-r--r--mm/memblock.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/mm/memblock.c b/mm/memblock.c
index 1c2ef2c..64ed243 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -291,6 +291,22 @@ phys_addr_t __init_memblock get_allocated_memblock_reserved_regions_info(
memblock.reserved.max);
}
+#ifdef CONFIG_ARCH_DISCARD_MEMBLOCK
+
+phys_addr_t __init_memblock get_allocated_memblock_memory_regions_info(
+ phys_addr_t *addr)
+{
+ if (memblock.memory.regions == memblock_memory_init_regions)
+ return 0;
+
+ *addr = __pa(memblock.memory.regions);
+
+ return PAGE_ALIGN(sizeof(struct memblock_region) *
+ memblock.memory.max);
+}
+
+#endif
+
/**
* memblock_double_array - double the size of the memblock regions array
* @type: memblock type of the regions array being doubled
OpenPOWER on IntegriCloud