Re: [PATCH 2/3] mm: drop pte_clear_not_present_full()
From: David Hildenbrand (Arm)
Date: Fri Jun 12 2026 - 05:38:44 EST
> * Context: The caller holds the page table lock. The PTEs are all not present.
> * The PTEs are all in the same PMD.
> @@ -989,7 +974,7 @@ static inline void clear_not_present_full_ptes(struct mm_struct *mm,
> unsigned long addr, pte_t *ptep, unsigned int nr, int full)
> {
> for (;;) {
> - pte_clear_not_present_full(mm, addr, ptep, full);
> + pte_clear(mm, addr, ptep);
> if (--nr == 0)
> break;
> ptep++;
> diff --git a/mm/madvise.c b/mm/madvise.c
> index cd9bb077072c..f3cda54c1d6a 100644
> --- a/mm/madvise.c
> +++ b/mm/madvise.c
> @@ -698,7 +698,7 @@ static int madvise_free_pte_range(pmd_t *pmd, unsigned long addr,
> clear_not_present_full_ptes(mm, addr, pte, nr, tlb->fullmm);
> } else if (softleaf_is_hwpoison(entry) ||
> softleaf_is_poison_marker(entry)) {
> - pte_clear_not_present_full(mm, addr, pte, tlb->fullmm);
> + pte_clear(mm, addr, pte);
Some odd configs seem to complain about addr not being used (when pte_clear() is
just a define that doesn't use addr).
I'll silence that by doing something like (void)addr;
--
Cheers,
David