Re: [PATCH RFC v3 3/3] iomap: bound ioend size to 4096 pages
From: Christoph Hellwig <hch@infradead.org>
Date: 2021-05-19 13:29:36
Also in:
linux-xfs
From: Christoph Hellwig <hch@infradead.org>
Date: 2021-05-19 13:29:36
Also in:
linux-xfs
On Mon, May 17, 2021 at 01:17:22PM -0400, Brian Foster wrote:
The iomap writeback infrastructure is currently able to construct extremely large bio chains (tens of GBs) associated with a single ioend. This consolidation provides no significant value as bio chains increase beyond a reasonable minimum size. On the other hand, this does hold significant numbers of pages in the writeback state across an unnecessarily large number of bios because the ioend is not processed for completion until the final bio in the chain completes. Cap an individual ioend to a reasonable size of 4096 pages (16MB with 4k pages) to avoid this condition.
Note that once we get huge page/folio support in the page cache this sucks as we can trivially handle much larger sizes with very little iteration. I wonder if both this limit and the previous one should be based on the number of pages added instead. And in fact maybe if we only want the limit at add to ioend time and skip the defer to workqueue part entirely.