Re: [PATCH 2/3] mm: drop pte_clear_not_present_full()

"David Hildenbrand (Arm)" <[email protected]> Fri, 12 Jun 2026 11:35:32 +0200
Newsgroups org.kernel.vger.sparclinux,org.kernel.vger.linux-kernel,org.kvack.linux-mm
Message-ID <[email protected]>
>   * 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