Commit dab6e717 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Dave Hansen
Browse files

mm: Rename pmd_read_atomic()



There's no point in having the identical routines for PTE/PMD have
different names.

Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20221022114424.841277397%40infradead.org
parent 6ca297d4
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -1352,11 +1352,6 @@ static inline int pud_trans_unstable(pud_t *pud)
#endif
}

static inline pmd_t pmd_read_atomic(pmd_t *pmdp)
{
	return pmdp_get_lockless(pmdp);
}

#ifndef arch_needs_pgtable_deposit
#define arch_needs_pgtable_deposit() (false)
#endif
@@ -1383,13 +1378,13 @@ static inline pmd_t pmd_read_atomic(pmd_t *pmdp)
 */
static inline int pmd_none_or_trans_huge_or_clear_bad(pmd_t *pmd)
{
	pmd_t pmdval = pmd_read_atomic(pmd);
	pmd_t pmdval = pmdp_get_lockless(pmd);
	/*
	 * The barrier will stabilize the pmdval in a register or on
	 * the stack so that it will stop changing under the code.
	 *
	 * When CONFIG_TRANSPARENT_HUGEPAGE=y on x86 32bit PAE,
	 * pmd_read_atomic is allowed to return a not atomic pmdval
	 * pmdp_get_lockless is allowed to return a not atomic pmdval
	 * (for example pointing to an hugepage that has never been
	 * mapped in the pmd). The below checks will only care about
	 * the low part of the pmd with 32bit PAE x86 anyway, with the
+1 −1
Original line number Diff line number Diff line
@@ -361,7 +361,7 @@ static int hmm_vma_walk_pmd(pmd_t *pmdp,
		 * huge or device mapping one and compute corresponding pfn
		 * values.
		 */
		pmd = pmd_read_atomic(pmdp);
		pmd = pmdp_get_lockless(pmdp);
		barrier();
		if (!pmd_devmap(pmd) && !pmd_trans_huge(pmd))
			goto again;
+1 −1
Original line number Diff line number Diff line
@@ -862,7 +862,7 @@ static int find_pmd_or_thp_or_none(struct mm_struct *mm,
	if (!*pmd)
		return SCAN_PMD_NULL;

	pmde = pmd_read_atomic(*pmd);
	pmde = pmdp_get_lockless(*pmd);

#ifdef CONFIG_TRANSPARENT_HUGEPAGE
	/* See comments in pmd_none_or_trans_huge_or_clear_bad() */
+1 −1
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ static int clean_record_pte(pte_t *pte, unsigned long addr,
static int wp_clean_pmd_entry(pmd_t *pmd, unsigned long addr, unsigned long end,
			      struct mm_walk *walk)
{
	pmd_t pmdval = pmd_read_atomic(pmd);
	pmd_t pmdval = pmdp_get_lockless(pmd);

	if (!pmd_trans_unstable(&pmdval))
		return 0;
+1 −1
Original line number Diff line number Diff line
@@ -294,7 +294,7 @@ static unsigned long change_pte_range(struct mmu_gather *tlb,
 */
static inline int pmd_none_or_clear_bad_unless_trans_huge(pmd_t *pmd)
{
	pmd_t pmdval = pmd_read_atomic(pmd);
	pmd_t pmdval = pmdp_get_lockless(pmd);

	/* See pmd_none_or_trans_huge_or_clear_bad for info on barrier */
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
Loading