linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64:free_initrd_mem should also free the memblock
@ 2014-09-12 10:17 Wang, Yalin
  2014-09-15 18:33 ` Will Deacon
  0 siblings, 1 reply; 10+ messages in thread
From: Wang, Yalin @ 2014-09-12 10:17 UTC (permalink / raw)
  To: 'Will Deacon', 'linux@arm.linux.org.uk',
	'linux-kernel@vger.kernel.org',
	'linux-arm-kernel@lists.infradead.org',
	'linux-mm@kvack.org'

this patch fix the memblock statics for memblock
in file /sys/kernel/debug/memblock/reserved
if we don't call memblock_free the initrd will still
be marked as reserved, even they are freed.

Signed-off-by: Yalin Wang <yalin.wang@sonymobile.com>
---
 arch/arm64/mm/init.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index 5472c24..34605c8 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -334,8 +334,10 @@ static int keep_initrd;
 
 void free_initrd_mem(unsigned long start, unsigned long end)
 {
-	if (!keep_initrd)
+	if (!keep_initrd) {
 		free_reserved_area((void *)start, (void *)end, 0, "initrd");
+		memblock_free(__pa(start), end - start);
+	}
 }
 
 static int __init keepinitrd_setup(char *__unused)
-- 
2.1.0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-09-18 12:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-12 10:17 [PATCH] arm64:free_initrd_mem should also free the memblock Wang, Yalin
2014-09-15 18:33 ` Will Deacon
2014-09-15 18:40   ` Russell King - ARM Linux
2014-09-15 18:50     ` Will Deacon
2014-09-16  1:53       ` Wang, Yalin
2014-09-17 16:28         ` Catalin Marinas
2014-09-17 18:12           ` Russell King - ARM Linux
2014-09-18  9:38             ` Wang, Yalin
2014-09-18  9:59               ` Russell King - ARM Linux
2014-09-18 12:13                 ` Wang, Yalin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox