提交 66311422 编写于 作者: T Tejun Heo 提交者: Jens Axboe

blkcg, writeback: dead memcgs shouldn't contribute to writeback ownership arbitration

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: NTejun Heo <tj@kernel.org>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 71c81407
...@@ -715,6 +715,7 @@ void wbc_detach_inode(struct writeback_control *wbc) ...@@ -715,6 +715,7 @@ void wbc_detach_inode(struct writeback_control *wbc)
void wbc_account_io(struct writeback_control *wbc, struct page *page, void wbc_account_io(struct writeback_control *wbc, struct page *page,
size_t bytes) size_t bytes)
{ {
struct cgroup_subsys_state *css;
int id; int id;
/* /*
...@@ -726,7 +727,12 @@ void wbc_account_io(struct writeback_control *wbc, struct page *page, ...@@ -726,7 +727,12 @@ void wbc_account_io(struct writeback_control *wbc, struct page *page,
if (!wbc->wb) if (!wbc->wb)
return; return;
id = mem_cgroup_css_from_page(page)->id; css = mem_cgroup_css_from_page(page);
/* dead cgroups shouldn't contribute to inode ownership arbitration */
if (!(css->flags & CSS_ONLINE))
return;
id = css->id;
if (id == wbc->wb_id) { if (id == wbc->wb_id) {
wbc->wb_bytes += bytes; wbc->wb_bytes += bytes;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册