diff options
author | Philipp Hachtmann <phacht@linux.vnet.ibm.com> | 2014-01-10 12:41:29 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2014-01-10 12:41:29 +1100 |
commit | a28f5622024f9eb82691710b7c7acdef80791c22 (patch) | |
tree | 4e8d605f273a114a9034afd2fd7ae3ef6651c237 /mm | |
parent | 602e93f4e56ef4160879eefc3079e739c8380fca (diff) |
mm-free-memblockmemory-in-free_all_bootmem-fix
Am Wed, 8 Jan 2014 12:08:04 +0800
schrieb Jianguo Wu <wujianguo@huawei.com>:
> For some archs, like arm64, would use memblock.memory after system
> booting, so we can not simply released to the buddy allocator, maybe
> need !defined(CONFIG_ARCH_DISCARD_MEMBLOCK).
Signed-off-by: Philipp Hachtmann <phacht@linux.vnet.ibm.com>
Cc: 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>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memblock.c | 4 | ||||
-rw-r--r-- | mm/nobootmem.c | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/mm/memblock.c b/mm/memblock.c index 41cb96a5c77d..64ed2439cf75 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -291,6 +291,8 @@ 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) { @@ -303,6 +305,8 @@ phys_addr_t __init_memblock get_allocated_memblock_memory_regions_info( memblock.memory.max); } +#endif + /** * memblock_double_array - double the size of the memblock regions array * @type: memblock type of the regions array being doubled diff --git a/mm/nobootmem.c b/mm/nobootmem.c index a6f357b801f2..17c89023184f 100644 --- a/mm/nobootmem.c +++ b/mm/nobootmem.c @@ -127,10 +127,13 @@ static unsigned long __init free_low_memory_core_early(void) if (size) count += __free_memory_core(start, start + size); +#ifdef CONFIG_ARCH_DISCARD_MEMBLOCK + /* Free memblock.memory array if it was allocated */ size = get_allocated_memblock_memory_regions_info(&start); if (size) count += __free_memory_core(start, start + size); +#endif return count; } |