Re: [PATCH RFC 4/5] mm/vmscan: be more careful when releasing FS metadata if buffer_heads_over_limit
From: Jan Kara
Date: Fri Nov 27 2026 - 08:59:41 EST
On Fri 27-11-26 13:37:15, Pedro Falcato wrote:
> On Wed, Nov 25, 2026 at 09:45:01AM +0100, Jan Kara wrote:
> > 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.
I don't believe it can ever activate without HIGHMEM - each bh points to
actual data in the folio it is attached to which, usless you have 512-byte
blocks, is more than 10x larger than struct buffer_head. So buffer heads
can never occupy more than 10% of total memory unless you are really trying
to screw up your system... And AFAIK this mechanism was introduced as
a HIGHMEM thing many years ago.
> 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.
Yes, that would be great.
Honza
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR