Re: [PATCH 20/25] s390/fbatch: no lru_add_drain_all() in s390_wiggle_split_folio()

From: Hugh Dickins

Date: Fri Aug 28 2026 - 18:03:03 EST


On Fri, 28 Aug 2026, Claudio Imbrenda wrote:
...
>
> so if I understand correctly, with this series the LRU caches
> will never hold extra references (as in refcount) on pages anymore,
> therefore calling lru_add_drain_all() will never decrease the refcount
> on any of the pages that are in any of the LRU caches

You understand correctly.

Though just before hitting send, I remembered one further detail.

lru_add_drain_all() also invalidates the buffer_head cache on each CPU:
entirely unrelated to mm's fbatches and LRUs, if I understand correctly
it's a genuine LRU cache of blockdev buffer_heads very useful to some
filessystems (e.g. for quick superblock access), which prevent the pages
(folios?) they are attached to from being freed while attached.

My understanding is very poor. but from glancing at the folio-oriented
kvm_s390_pv_make_secure(), I'll guess that you have no need for that
aspect of lru_add_drain_all(). But if you think that you do, then
we can replace your lru_add_drain_all() by an invalidate_bh_lrus()
(like 22/25 does to drop_caches).

>
> in that case the lru drain can indeed go

Thanks for confirming - but please reconfirm in the light of those
buffer_heads.

Hugh