Thread (12 messages) 12 messages, 4 authors, 2018-11-27

Re: [PATCH 4/5] openrisc: simplify pte_alloc_one_kernel()

From: Mike Rapoport <hidden>
Date: 2018-11-27 21:49:01
Also in: linux-arm-kernel, linux-mm, linux-sh, lkml, sparclinux


On November 27, 2018 11:16:00 PM GMT+02:00, Stafford Horne [off-list ref] wrote:
On Sun, Nov 25, 2018 at 11:44:36PM +0200, Mike Rapoport wrote:
quoted
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
quoted
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?
quoted
Signed-off-by: Mike Rapoport <redacted>
Acked-by: Stafford Horne <shorne@gmail.com>
Thanks!
quoted
---
 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,
quoted
 {
 	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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help