Re: [PATCH RFC 4/5] mm/vmscan: be more careful when releasing FS metadata if buffer_heads_over_limit
From: Pedro Falcato
Date: Fri Nov 27 2026 - 08:37:29 EST
On Wed, Nov 25, 2026 at 09:45:01AM +0100, Jan Kara wrote:
> On Thu 19-11-26 20:10:47, Pedro Falcato wrote:
> > Namely, don't call ->release_folio() for mapped or referenced folios.
> > Since this is the active list, there's no actual point in doing
> > unmapping. In fact, that would be counterproductive for active folios.
> >
> > So, gate on !mapped && may_release_folio.
> >
> > Reported-by: David Hildenbrand <david@xxxxxxxxxx>
> > Cc: stable@xxxxxxxxxxxxxxx
> > Fixes: d824ec2a1546 ("mm: do not reclaim private data from pinned page")
> > Signed-off-by: Pedro Falcato <pfalcato@xxxxxxx>
>
> This is OK with me but so feel free to add:
>
> Reviewed-by: Jan Kara <jack@xxxxxxx>
Thanks!
>
> Just given buffer_heads_over_limit is a HIGHMEM thing and given how much we
> care (not) about HIGHMEM, maybe just completely ripping out the whole
> buffer_heads_over_limit logic is a better "solution"? I mean it's a crude
> heuristic anyway and for struct buffer_head to occupy significant portion
> of ZONE_NORMAL, you'd have to have several GB of pagecache with buffers
> which means the machine has to have quite some highmem which makes the
> setup even more dubious...
Is it _just_ a HIGHMEM thing? I had the impression it had some effect as
a general buffer_head shrinker. Either way, I do think we can remove it,
but I chose not to do it for stable; also, I don't have technical arguments
as to why it's useless, I just assume it is.
Other filesystems (iomap, XFS, btrfs) don't participate in this scheme and
they turn out just fine. So, unless you find something I'm missing, I will
probably send a (separate) patch removing this whole mechanism for next.
--
Pedro