All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: Joe Perches <joe@perches.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	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: Tue, 3 Aug 2021 10:58:42 +0300	[thread overview]
Message-ID: <YQj3MqOON6qySFFa@kernel.org> (raw)
In-Reply-To: <72be13936ca341897d2fd7c65fb4345a8467c571.camel@perches.com>

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:
> > 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)

Maybe, but I'm not sure it's worth the churn.
 
> > @@ -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.

  reply	other threads:[~2021-08-03  7:58 UTC|newest]

Thread overview: 18+ 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
2021-07-31 17:13     ` Joe Perches
2021-08-03  7:58     ` Mike Rapoport [this message]
2021-08-03 16:19       ` Joe Perches
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=YQj3MqOON6qySFFa@kernel.org \
    --to=rppt@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=monstr@monstr.eu \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.