lkml.org 
[lkml]   [2021]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 4/4] memblock: stop poisoning raw allocations
From
Date
On Wed, 2021-07-14 at 15:37 +0300, Mike Rapoport wrote:
> From: Mike Rapoport <rppt@linux.ibm.com>
>
> 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.
[]
> diff --git a/mm/memblock.c b/mm/memblock.c
[]
> @@ -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)

> @@ -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

\
 
 \ /
  Last update: 2021-07-31 19:13    [W:0.134 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site