Re: [PATCH v3 0/2] writeback: let foreign flushes reach dying cgwbs

From: Tejun Heo

Date: Tue Sep 29 2026 - 15:33:42 EST


Hello, Liz.

On Tue, Sep 29, 2026 at 01:40:49AM +0000, Liz Fong-Jones wrote:
> 1.5s and 19.5s with it), because writing back the old wb's backlog took
> up to 27s and the sibling's foreign flushes reached the new wb in the
> meantime. Should foreign flushes also reach a replaced wb until it is
> clean, or is that not worth it for this case?

I don't think the old wb needs to stay reachable if the new wb takes
over its inodes. Instead of kicking writeback, can the takeover queue a
work item which switches all of the old wb's inodes to the new wb, like
cleanup_offline_cgwb() does for b_attached and b_dirty_time? The switch
carries the dirty and writeback page counts, so foreign flushes reach
the inodes through the new wb and nothing needs to be flushed right
away.

That would also mean switching inodes on b_dirty, b_io and b_more_io
while the flusher may be working on the old wb, which I'm not sure is
safe. Jan, would that be okay?

Thanks.

--
tejun