Thread (32 messages) 32 messages, 10 authors, 2025-03-15

Re: [PATCH 07/13] s390: make setup_zero_pages() use memblock

From: Heiko Carstens <hca@linux.ibm.com>
Date: 2025-03-07 15:29:29
Also in: linux-alpha, linux-arch, linux-m68k, linux-mips, linux-mm, linux-riscv, linux-s390, linux-sh, linux-um, lkml, loongarch, sparclinux

On Thu, Mar 06, 2025 at 08:51:17PM +0200, Mike Rapoport wrote:
From: "Mike Rapoport (Microsoft)" <rppt@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@kernel.org>
---
 arch/s390/mm/init.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
Acked-by: Heiko Carstens <hca@linux.ibm.com>
-	empty_zero_page = __get_free_pages(GFP_KERNEL | __GFP_ZERO, order);
+	empty_zero_page = (unsigned long)memblock_alloc(PAGE_SIZE << order, order);
 	if (!empty_zero_page)
 		panic("Out of memory in setup_zero_pages");
This could have been converted to memblock_alloc_or_panic(), but I
guess this can also be done at a later point in time.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help