linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@linux.ibm.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 4/5] openrisc: simplify pte_alloc_one_kernel()
Date: Tue, 27 Nov 2018 21:48:45 +0000	[thread overview]
Message-ID: <7843DE67-DCC3-48BF-873F-71D87B08EDA8@linux.ibm.com> (raw)
In-Reply-To: <20181127211600.GB3235@lianli.shorne-pla.net>



On November 27, 2018 11:16:00 PM GMT+02:00, Stafford Horne <shorne@gmail.com> wrote:
>On Sun, Nov 25, 2018 at 11:44:36PM +0200, Mike Rapoport wrote:
>> The pte_alloc_one_kernel() function allocates a page using
>> __get_free_page(GFP_KERNEL) when mm initialization is complete and
>> memblock_phys_alloc() on the earlier stages. The physical address of
>the
>> page allocated with memblock_phys_alloc() is converted to the virtual
>> address and in the both cases the allocated page is cleared using
>> clear_page().
>> 
>> The code is simplified by replacing __get_free_page() with
>> get_zeroed_page() and by replacing memblock_phys_alloc() with
>> memblock_alloc().
>
>Hello Mike,
>
>This looks fine to me.  How do you plan to get this merged?  Will you
>be taking
>care of the whole series or so you want me to queue this openrisc part?

I was thinking about merging via the -mm tree.
Andrew, would that be ok?

>> Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
>
>Acked-by: Stafford Horne <shorne@gmail.com>

Thanks!

>> ---
>>  arch/openrisc/mm/ioremap.c | 11 ++++-------
>>  1 file changed, 4 insertions(+), 7 deletions(-)
>> 
>> diff --git a/arch/openrisc/mm/ioremap.c b/arch/openrisc/mm/ioremap.c
>> index c969752..cfef989 100644
>> --- a/arch/openrisc/mm/ioremap.c
>> +++ b/arch/openrisc/mm/ioremap.c
>> @@ -123,13 +123,10 @@ pte_t __ref *pte_alloc_one_kernel(struct
>mm_struct *mm,
>>  {
>>  	pte_t *pte;
>>  
>> -	if (likely(mem_init_done)) {
>> -		pte = (pte_t *) __get_free_page(GFP_KERNEL);
>> -	} else {
>> -		pte = (pte_t *) __va(memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE));
>> -	}
>> +	if (likely(mem_init_done))
>> +		pte = (pte_t *)get_zeroed_page(GFP_KERNEL);
>> +	else
>> +		pte = memblock_alloc(PAGE_SIZE, PAGE_SIZE);
>>  
>> -	if (pte)
>> -		clear_page(pte);
>>  	return pte;
>>  }
>> -- 
>> 2.7.4
>> 

-- 
Sincerely yours,
Mike.

  reply	other threads:[~2018-11-27 21:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-25 21:44 [PATCH 0/5] memblock: simplify several early memory allocations Mike Rapoport
2018-11-25 21:44 ` [PATCH 1/5] powerpc: prefer memblock APIs returning virtual address Mike Rapoport
2018-11-25 21:44 ` [PATCH 2/5] microblaze: prefer memblock API " Mike Rapoport
2018-11-25 21:44 ` [PATCH 3/5] sh: prefer memblock APIs " Mike Rapoport
2018-11-25 21:44 ` [PATCH 4/5] openrisc: simplify pte_alloc_one_kernel() Mike Rapoport
2018-11-27 21:16   ` Stafford Horne
2018-11-27 21:48     ` Mike Rapoport [this message]
2018-11-25 21:44 ` [PATCH 5/5] arch: simplify several early memory allocations Mike Rapoport
2018-11-26  7:03   ` Christophe LEROY
2018-11-26  7:25     ` Mike Rapoport
2018-11-26  8:21   ` Christoph Hellwig
2018-11-26  8:47     ` Mike Rapoport

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=7843DE67-DCC3-48BF-873F-71D87B08EDA8@linux.ibm.com \
    --to=rppt@linux.ibm.com \
    --cc=linux-arm-kernel@lists.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;
as well as URLs for NNTP newsgroup(s).