diff options
| author | Xin Yin <yinxin.x@bytedance.com> | 2026-09-24 14:54:43 +0800 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-09-25 17:24:29 +0200 |
| commit | 168a8c13159c6e3f0f08da6f8fa2f633a91ba9fd (patch) | |
| tree | d7c0633cc5426949b9f2b9913e9c71f33d266205 /tools/lib/python | |
| parent | b53f422491af2a134a57c1cffea67c575a1f699f (diff) | |
| download | linux-next-168a8c13159c6e3f0f08da6f8fa2f633a91ba9fd.tar.gz linux-next-168a8c13159c6e3f0f08da6f8fa2f633a91ba9fd.zip | |
writeback: size foreign flushes by target wb dirty pages
Foreign dirty tracking records the bdi and wb memcg IDs of recently
dirtied foreign inodes. When the source memcg needs foreign writeback,
mem_cgroup_flush_foreign() queues WB_REASON_FOREIGN_FLUSH to the
recorded target bdi_writeback.
cgroup_writeback_by_id() currently sizes this best-effort work from the
target memcg's NR_FILE_DIRTY counter. The work is scoped to one target
wb, so a memcg-wide dirty count can over-size a single-bdi flush when
the target memcg has dirty pages on other devices. It can also under-size
the flush when the target wb has dirty pages charged to other memcgs.
Over-sizing keeps the target wb busy longer and can delay later
writeback work. Under-sizing can finish before enough pages are written
back for the source memcg.
Use the target wb's WB_RECLAIMABLE counter and keep the existing 25%
headroom. This keeps the budget aligned with the writeback object being
queued.
Fixes: 97b27821b485 ("writeback, memcg: Implement foreign dirty flushing")
Reviewed-by: Jan Kara <jack@suse.cz>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Xin Yin <yinxin.x@bytedance.com>
Link: https://patch.msgid.link/20260924065443.1650126-1-yinxin.x@bytedance.com
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
