linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@linux.ibm.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	Helge Deller <deller@gmx.de>,
	linux-parisc@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] parisc: use memblock_alloc() instead of custom get_memblock()
Date: Tue, 12 Feb 2019 16:40:52 +0200	[thread overview]
Message-ID: <20190212144052.GB20902@rapoport-lnx> (raw)
In-Reply-To: <20190212141418.GM12668@bombadil.infradead.org>

On Tue, Feb 12, 2019 at 06:14:18AM -0800, Matthew Wilcox wrote:
> On Tue, Feb 12, 2019 at 03:59:50PM +0200, Mike Rapoport wrote:
> > -static void * __init get_memblock(unsigned long size)
> > -{
> > -	static phys_addr_t search_addr __initdata;
> > -	phys_addr_t phys;
> > -
> > -	if (!search_addr)
> > -		search_addr = PAGE_ALIGN(__pa((unsigned long) &_end));
> > -	search_addr = ALIGN(search_addr, size);
> > -	while (!memblock_is_region_memory(search_addr, size) ||
> > -		memblock_is_region_reserved(search_addr, size)) {
> > -		search_addr += size;
> > -	}
> > -	phys = search_addr;
> 
> This implies to me that the allocation will be 'size' aligned.
> 
> >  		if (!pmd) {
> > -			pmd = (pmd_t *) get_memblock(PAGE_SIZE << PMD_ORDER);
> > +			pmd = memblock_alloc(PAGE_SIZE << PMD_ORDER,
> > +					     SMP_CACHE_BYTES);
> 
> So why would this only need to be cacheline aligned?  It's pretty common
> for hardware to require that pgd/pud/pmd/pte tables be naturally aligned.
> 
> > @@ -700,7 +683,10 @@ static void __init pagetable_init(void)
> >  	}
> >  #endif
> >  
> > -	empty_zero_page = get_memblock(PAGE_SIZE);
> > +	empty_zero_page = memblock_alloc(PAGE_SIZE, SMP_CACHE_BYTES);
> 
> ... and surely the zero page also needs to be page aligned, by definition.
 
Right, I've completely missed the alignment. Will fix.

-- 
Sincerely yours,
Mike.


      reply	other threads:[~2019-02-12 14:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-12 13:59 Mike Rapoport
2019-02-12 14:14 ` Matthew Wilcox
2019-02-12 14:40   ` Mike Rapoport [this message]

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=20190212144052.GB20902@rapoport-lnx \
    --to=rppt@linux.ibm.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=deller@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=willy@infradead.org \
    /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