Re: [PATCH RFC v3 1/2] filemap: defer dropbehind invalidation from IRQ context

From: Matthew Wilcox

Date: Mon Mar 02 2026 - 12:38:24 EST


On Mon, Mar 02, 2026 at 10:11:19AM +0100, Jan Kara wrote:
> Folio batches are relatively small (31 folios). With 4k folios it is very
> easy to overflow the batch with a single IO completion. Large folios will
> obviously make this less likely but I'm not sure reasonable working of
> dropbehind should be dependent on large folios... Not sure how to best
> address this though. We could use larger batches but that would mean using
> our own array of folios instead of folio_batch.

That's why I think we should allow the bio to be tagged as
"finish the bio in workqueue context",
https://lore.kernel.org/linux-fsdevel/aaC3LUFa1Jz2ahk3@xxxxxxxxxxxxxxxxxxxx/

Why remove the folios from one data structure, to put them into a
different data structure that they don't necessarily fit in, rather than
just postpone processing to workqueue context?