Re: [PATCH] writeback: let foreign flushes reach dying cgwbs

From: Tejun Heo

Date: Mon Sep 28 2026 - 15:19:43 EST


Hello, Liz.

On Sun, Sep 27, 2026 at 05:04:39AM +0000, Liz Fong-Jones wrote:
> Fall back to searching bdi->wb_list, where killed wbs stay until they
> are released. With commit 168a8c13159c ("writeback: size foreign
> flushes by target wb dirty pages"), the flush is then sized from the
> wb's own dirty pages and writes out what the replacement dirtied.

Instead of walking bdi->wb_list, can't we update the lifetime rule so that
a wb stays on bdi->cgwb_tree until it's actually released? That is, remove
it from the tree in cgwb_release_workfn() instead of cgwb_kill() and have
the creation paths skip dying wbs. cgroup_writeback_by_id() would then
find the dying wb through the regular lookup.

Note that the blkcg association check in wb_get_lookup() would have to
move to the creation side. If io is enabled on the removed cgroup,
cgroup_get_e_css() returns an ancestor's io css and a dying wb would never
match.

> Fixes: d62241c7a406 ("writeback, memcg: Implement cgroup_writeback_by_id()")
> Cc: stable@xxxxxxxxxxxxxxx

I don't think this qualifies as a fix. Can you drop the Fixes: and stable
tags?

Thanks.

--
tejun