Skip to content

Commit

Permalink
mm/thp: rename pmd_to_page() as pmd_pgtable_page()
Browse files Browse the repository at this point in the history
Current pmd_to_page(), which derives the page table page containing the
pmd address has a very misleading name.  The problem being, it sounds
similar to pmd_page() which derives page embedded in a given pmd entry
either for next level page or a mapped huge page.  Rename it as
pmd_pgtable_page() instead.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Anshuman Khandual <[email protected]>
Cc: Mike Kravetz <[email protected]>
Cc: "Kirill A. Shutemov" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
Anshuman Khandual authored and akpm00 committed Nov 30, 2022
1 parent 8d9b637 commit 373dfda
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -2510,15 +2510,15 @@ static inline void pgtable_pte_page_dtor(struct page *page)

#if USE_SPLIT_PMD_PTLOCKS

static struct page *pmd_to_page(pmd_t *pmd)
static struct page *pmd_pgtable_page(pmd_t *pmd)
{
unsigned long mask = ~(PTRS_PER_PMD * sizeof(pmd_t) - 1);
return virt_to_page((void *)((unsigned long) pmd & mask));
}

static inline spinlock_t *pmd_lockptr(struct mm_struct *mm, pmd_t *pmd)
{
return ptlock_ptr(pmd_to_page(pmd));
return ptlock_ptr(pmd_pgtable_page(pmd));
}

static inline bool pmd_ptlock_init(struct page *page)
Expand All @@ -2537,7 +2537,7 @@ static inline void pmd_ptlock_free(struct page *page)
ptlock_free(page);
}

#define pmd_huge_pte(mm, pmd) (pmd_to_page(pmd)->pmd_huge_pte)
#define pmd_huge_pte(mm, pmd) (pmd_pgtable_page(pmd)->pmd_huge_pte)

#else

Expand Down

0 comments on commit 373dfda

Please sign in to comment.