Re: [PATCH v3 1/9] mm: limit pagecache folio refcount when mapping pages

From: David Hildenbrand (Arm)

Date: Thu Nov 12 2026 - 06:04:06 EST


>
> diff --git a/mm/filemap.c b/mm/filemap.c
> index 9871b4f32a916..0f6d57432a7e5 100644
> --- a/mm/filemap.c
> +++ b/mm/filemap.c
> @@ -3968,6 +3968,11 @@ vm_fault_t filemap_map_pages(struct vm_fault *vmf,
> unsigned long end;
> vm_fault_t map_ret;
>
> + if (unlikely(folio_ref_count_over_limit(folio))) {
> + folio_ref_dec(folio);

Going over this once more, I'll just use folio_put() here for consistency.

--
Cheers,

David