[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210126181420.19223-1-david@redhat.com>
Date: Tue, 26 Jan 2021 19:14:20 +0100
From: David Hildenbrand <david@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: linux-mm@...ck.org, linux-csky@...r.kernel.org,
David Hildenbrand <david@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Guo Ren <guoren@...nel.org>, Mike Rapoport <rppt@...nel.org>,
Oscar Salvador <osalvador@...e.de>,
Michal Hocko <mhocko@...nel.org>,
Wei Yang <richard.weiyang@...ux.alibaba.com>
Subject: [PATCH v1] csky: use free_initmem_default() in free_initmem()
The existing code is essentially
free_initmem_default()->free_reserved_area() without poisoning.
Note that existing code missed to update the managed page count of the
zone.
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Guo Ren <guoren@...nel.org>
Cc: Mike Rapoport <rppt@...nel.org>
Cc: Oscar Salvador <osalvador@...e.de>
Cc: Michal Hocko <mhocko@...nel.org>
Cc: Wei Yang <richard.weiyang@...ux.alibaba.com>
Signed-off-by: David Hildenbrand <david@...hat.com>
---
Not compile tested as documentation on how to get
https://gitlab.com/c-sky/buildroot
running, especially with a custom kernel, is a bit sparse.
---
arch/csky/mm/init.c | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/arch/csky/mm/init.c b/arch/csky/mm/init.c
index 81e4e5e78f38..894050a8ce09 100644
--- a/arch/csky/mm/init.c
+++ b/arch/csky/mm/init.c
@@ -110,24 +110,9 @@ void __init mem_init(void)
mem_init_print_info(NULL);
}
-extern char __init_begin[], __init_end[];
-
void free_initmem(void)
{
- unsigned long addr;
-
- addr = (unsigned long) &__init_begin;
-
- while (addr < (unsigned long) &__init_end) {
- ClearPageReserved(virt_to_page(addr));
- init_page_count(virt_to_page(addr));
- free_page(addr);
- totalram_pages_inc();
- addr += PAGE_SIZE;
- }
-
- pr_info("Freeing unused kernel memory: %dk freed\n",
- ((unsigned int)&__init_end - (unsigned int)&__init_begin) >> 10);
+ free_initmem_default(-1);
}
void pgd_init(unsigned long *p)
--
2.29.2
Powered by blists - more mailing lists