blkcg, writeback: dead memcgs shouldn't contribute to writeback ownership arbitration
authorTejun Heo <tj@kernel.org>
Thu, 13 Jun 2019 22:30:41 +0000 (15:30 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 Aug 2019 07:33:20 +0000 (09:33 +0200)
commit587a816cbe4cc9e6607e83ffe20c36582deca111
tree505503583b9901207450a1d5f87207ca63f0c354
parent8151383a170ae82a3c795027cf79933cd6a1edd9
blkcg, writeback: dead memcgs shouldn't contribute to writeback ownership arbitration

[ Upstream commit 6631142229005e1b1c311a09efe9fb3cfdac8559 ]

wbc_account_io() collects information on cgroup ownership of writeback
pages to determine which cgroup should own the inode.  Pages can stay
associated with dead memcgs but we want to avoid attributing IOs to
dead blkcgs as much as possible as the association is likely to be
stale.  However, currently, pages associated with dead memcgs
contribute to the accounting delaying and/or confusing the
arbitration.

Fix it by ignoring pages associated with dead memcgs.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/fs-writeback.c