Thread (16 messages) 16 messages, 6 authors, 2021-08-25

Re: [PATCH 4/4] memblock: stop poisoning raw allocations

From: Mike Rapoport <rppt@kernel.org>
Date: 2021-08-03 07:58:51
Also in: lkml

On Sat, Jul 31, 2021 at 10:13:04AM -0700, Joe Perches wrote:
On Wed, 2021-07-14 at 15:37 +0300, Mike Rapoport wrote:
quoted
From: Mike Rapoport <redacted>

Functions memblock_alloc_exact_nid_raw() and memblock_alloc_try_nid_raw()
are intended for early memory allocation without overhead of zeroing the
allocated memory. Since these functions were used to allocate the memory
map, they have ended up with addition of a call to page_init_poison() that
poisoned the allocated memory when CONFIG_PAGE_POISON was set.

Since the memory map is allocated using a dedicated memmep_alloc() function
that takes care of the poisoning, remove page poisoning from the
memblock_alloc_*_raw() functions.
[]
quoted
diff --git a/mm/memblock.c b/mm/memblock.c
[]
quoted
@@ -1490,18 +1490,12 @@ void * __init memblock_alloc_exact_nid_raw(
 			phys_addr_t min_addr, phys_addr_t max_addr,
 			int nid)
 {
-	void *ptr;
-
 	memblock_dbg("%s: %llu bytes align=0x%llx nid=%d from=%pa max_addr=%pa %pS\n",
 		     __func__, (u64)size, (u64)align, nid, &min_addr,
 		     &max_addr, (void *)_RET_IP_);
unassociated trivia:

casting _RET_IP_ back to void * seems odd as the define is
include/linux/kernel.h:#define _RET_IP_         (unsigned long)__builtin_return_address(0)

It's probably easier to understand as just __builtin_return_address(0)
Maybe, but I'm not sure it's worth the churn.
 
quoted
@@ -1528,18 +1522,12 @@ void * __init memblock_alloc_try_nid_raw(
 			phys_addr_t min_addr, phys_addr_t max_addr,
 			int nid)
 {
-	void *ptr;
-
 	memblock_dbg("%s: %llu bytes align=0x%llx nid=%d from=%pa max_addr=%pa %pS\n",
 		     __func__, (u64)size, (u64)align, nid, &min_addr,
 		     &max_addr, (void *)_RET_IP_);
here too
-- 
Sincerely yours,
Mike.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help