Skip to content

Commit

Permalink
sparc64: convert various functions to use ptdescs
Browse files Browse the repository at this point in the history
As part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents, convert various page table functions to use ptdescs.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Vishal Moola (Oracle) <[email protected]>
Acked-by: Mike Rapoport (IBM) <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Christophe Leroy <[email protected]>
Cc: Claudio Imbrenda <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Dinh Nguyen <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Guo Ren <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: John Paul Adrian Glaubitz <[email protected]>
Cc: Jonas Bonn <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Richard Weinberger <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: Yoshinori Sato <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
VMoola authored and akpm00 committed Aug 21, 2023
1 parent bb3be38 commit b3311d7
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions arch/sparc/mm/init_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -2893,14 +2893,15 @@ pte_t *pte_alloc_one_kernel(struct mm_struct *mm)

pgtable_t pte_alloc_one(struct mm_struct *mm)
{
struct page *page = alloc_page(GFP_KERNEL | __GFP_ZERO);
if (!page)
struct ptdesc *ptdesc = pagetable_alloc(GFP_KERNEL | __GFP_ZERO, 0);

if (!ptdesc)
return NULL;
if (!pgtable_pte_page_ctor(page)) {
__free_page(page);
if (!pagetable_pte_ctor(ptdesc)) {
pagetable_free(ptdesc);
return NULL;
}
return (pte_t *) page_address(page);
return ptdesc_address(ptdesc);
}

void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
Expand All @@ -2910,10 +2911,10 @@ void pte_free_kernel(struct mm_struct *mm, pte_t *pte)

static void __pte_free(pgtable_t pte)
{
struct page *page = virt_to_page(pte);
struct ptdesc *ptdesc = virt_to_ptdesc(pte);

pgtable_pte_page_dtor(page);
__free_page(page);
pagetable_pte_dtor(ptdesc);
pagetable_free(ptdesc);
}

void pte_free(struct mm_struct *mm, pgtable_t pte)
Expand Down

0 comments on commit b3311d7

Please sign in to comment.