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>
This commit is contained in:

committed by
Linus Torvalds

parent
87379ec8c2
commit
5e270e2548
@@ -122,11 +122,19 @@ static unsigned long __init free_low_memory_core_early(void)
|
||||
for_each_free_mem_range(i, NUMA_NO_NODE, &start, &end, NULL)
|
||||
count += __free_memory_core(start, end);
|
||||
|
||||
/* free range that is used for reserved array if we allocate it */
|
||||
/* Free memblock.reserved array if it was allocated */
|
||||
size = get_allocated_memblock_reserved_regions_info(&start);
|
||||
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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user