Re: [PATCH] mm: huge_memory: add folio_mark_accessed() when zapping file THP
From: Oscar Salvador
Date: Thu Apr 10 2025 - 23:14:48 EST
On Fri, Apr 11, 2025 at 09:07:16AM +0800, Baolin Wang wrote:
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index b3ade7ac5bbf..93abd1fcc4fb 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -2263,6 +2263,10 @@ int zap_huge_pmd(struct mmu_gather *tlb, struct
> vm_area_struct *vma,
> add_mm_counter(tlb->mm, mm_counter_file(folio),
> -HPAGE_PMD_NR);
>
> + /*
> + * Use flush_needed to indicate whether the PMD
> entry is present,
> + * instead of checking pmd_present() again.
> + */
> if (flush_needed && pmd_young(orig_pmd) &&
> likely(vma_has_recency(vma)))
> folio_mark_accessed(folio);
Yes, thanks, looks good to me, and I see that Andrew has already taken
it.
--
Oscar Salvador
SUSE Labs