提交 05c58752 编写于 作者: C CHANDAN VN 提交者: Will Deacon

arm64: To remove initrd reserved area entry from memblock

INITRD reserved area entry is not removed from memblock
even though initrd reserved area is freed. After freeing
the memory it is released from memblock. The same can be
checked from /sys/kernel/debug/memblock/reserved.

The patch makes sure that the initrd entry is removed from
memblock when keepinitrd is not enabled.

The patch only affects accounting and debugging. This does not
fix any memory leak.
Acked-by: NLaura Abbott <labbott@redhat.com>
Signed-off-by: NCHANDAN VN <chandan.vn@samsung.com>
Signed-off-by: NWill Deacon <will.deacon@arm.com>
上级 6da6c0db
...@@ -646,8 +646,10 @@ static int keep_initrd __initdata; ...@@ -646,8 +646,10 @@ static int keep_initrd __initdata;
void __init free_initrd_mem(unsigned long start, unsigned long end) void __init free_initrd_mem(unsigned long start, unsigned long end)
{ {
if (!keep_initrd) if (!keep_initrd) {
free_reserved_area((void *)start, (void *)end, 0, "initrd"); free_reserved_area((void *)start, (void *)end, 0, "initrd");
memblock_free(__virt_to_phys(start), end - start);
}
} }
static int __init keepinitrd_setup(char *__unused) static int __init keepinitrd_setup(char *__unused)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册