Re: [PATCH v1 1/3] mm: process_mrelease: expedite clean file folio reclaim via mmu_gather

Matthew Wilcox
2026-04-24T19:33:11Z

On Tue, Apr 21, 2026 at 04:02:37PM -0700, Minchan Kim wrote:
> +++ b/mm/swap.c
> @@ -1043,6 +1043,48 @@ void release_pages(release_pages_arg arg, int nr)
> }
> EXPORT_SYMBOL(release_pages);
>
> +static inline void free_file_cache(struct folio *folio)
> +{
> + if (folio_trylock(folio)) {
> + mapping_evict_folio(folio_mapping(folio), folio);

If we already know that the folio is for a file (and I think we do?)
then we can just use folio->mapping here. On the other hand, if it
could be KSM or something else weird, carry on.