linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Mike Rapoport <rppt@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Simek <monstr@monstr.eu>,
	Mike Rapoport <rppt@linux.ibm.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 4/4] memblock: stop poisoning raw allocations
Date: Sat, 31 Jul 2021 10:13:04 -0700	[thread overview]
Message-ID: <72be13936ca341897d2fd7c65fb4345a8467c571.camel@perches.com> (raw)
In-Reply-To: <20210714123739.16493-5-rppt@kernel.org>

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


  reply	other threads:[~2021-07-31 17:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-14 12:37 [PATCH 0/4] mm: ensure consistency of memory map poisoning Mike Rapoport
2021-07-14 12:37 ` [PATCH 1/4] mm/page_alloc: always initialize memory map for the holes Mike Rapoport
2021-07-31 16:56   ` Guenter Roeck
2021-07-31 18:30     ` Mike Rapoport
2021-07-31 19:11       ` Guenter Roeck
2021-08-25 12:11   ` David Hildenbrand
2021-07-14 12:37 ` [PATCH 2/4] microblaze: simplify pte_alloc_one_kernel() Mike Rapoport
2021-08-25 10:09   ` Michal Simek
2021-08-25 12:13   ` David Hildenbrand
2021-07-14 12:37 ` [PATCH 3/4] mm: introduce memmap_alloc() to unify memory map allocation Mike Rapoport
2021-07-14 22:32   ` Andrew Morton
2021-07-15  6:10     ` Mike Rapoport
2021-07-14 12:37 ` [PATCH 4/4] memblock: stop poisoning raw allocations Mike Rapoport
2021-07-31 17:13   ` Joe Perches [this message]
2021-08-03  7:58     ` Mike Rapoport
2021-08-03 16:19       ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=72be13936ca341897d2fd7c65fb4345a8467c571.camel@perches.com \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=monstr@monstr.eu \
    --cc=rppt@kernel.org \
    --cc=rppt@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).