[PATCH 05/13] MIPS: make setup_zero_pages() use memblock
Mike Rapoport
rppt at kernel.org
Mon Mar 10 22:57:23 PDT 2025
On Thu, Mar 06, 2025 at 08:51:15PM +0200, Mike Rapoport wrote:
> From: "Mike Rapoport (Microsoft)" <rppt at kernel.org>
>
> Allocating the zero pages from memblock is simpler because the memory is
> already reserved.
>
> This will also help with pulling out memblock_free_all() to the generic
> code and reducing code duplication in arch::mem_init().
>
> Signed-off-by: Mike Rapoport (Microsoft) <rppt at kernel.org>
> ---
> arch/mips/include/asm/mmzone.h | 2 --
> arch/mips/mm/init.c | 16 +++++-----------
> 2 files changed, 5 insertions(+), 13 deletions(-)
Andrew can you please pick this as a fixup?
>From 148713d17cbdf7a3ad08f18ba203185b70c0e7c2 Mon Sep 17 00:00:00 2001
From: "Mike Rapoport (Microsoft)" <rppt at kernel.org>
Date: Tue, 11 Mar 2025 07:51:27 +0200
Subject: [PATCH] MIPS: use memblock_alloc_or_panic() in setup_zero_page()
Signed-off-by: Mike Rapoport (Microsoft) <rppt at kernel.org>
---
arch/mips/mm/init.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 6ea27bbd387e..a673d3d68254 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -68,9 +68,7 @@ static void __init setup_zero_pages(void)
else
order = 0;
- empty_zero_page = (unsigned long)memblock_alloc(PAGE_SIZE << order, PAGE_SIZE);
- if (!empty_zero_page)
- panic("Oh boy, that early out of memory?");
+ empty_zero_page = (unsigned long)memblock_alloc_or_panic(PAGE_SIZE << order, PAGE_SIZE);
zero_page_mask = ((PAGE_SIZE << order) - 1) & PAGE_MASK;
}
--
2.47.2
--
Sincerely yours,
Mike.
More information about the linux-riscv
mailing list