[PATCHSET 3/3 v2 block/for-4.1/core] writeback: implement foreign cgroup inode bdi_writeback switching
From: Tejun Heo
Date: Mon Apr 06 2015 - 16:18:40 EST
The changes from the last take[L] are
* inode_wb_stat_unlocked_begin/end() are generalized and renamed to
inode_wb_unlocked_begin/end() and now used for inode_congested()
which needs to determine the associated wb locklessly. This adds
added to implement immediate switching from dead wb's.
The previous two patchsets  implemented cgroup writeback support
and backpressure propagation through dirty throttling mechanism;
however, the inode is assigned to the wb (bdi_writeback) matching the
first dirtied page and stays there until released. This first-use
policy can easily lead to gross misbehaviors - a single stray dirty
page can cause gigatbytes to be written by the wrong cgroup. Also,
while concurrently write sharing an inode is extremely rare and
unsupported, inodes jumping cgroups over time are more common.
This patchset implements foreign cgroup inode detection and wb
switching. Each writeback run tracks the majority wb being written
using a simple but fairly robust algorithm and when an inode
persistently writes out more foreign cgroup pages than local ones, the
inode is transferred to the majority winner.
This patchset adds 8 bytes to inode making the total per-inode space
overhead of cgroup writeback support 16 bytes on 64bit systems. The
computational overhead should be negligible. If the writer changes
from one cgroup to another entirely, the mechanism can render the
correct switch verdict in several seconds of IO time in most cases and
it can converge on the correct answer in reasonable amount of time
even in more ambiguous cases.
This patchset contains the following 8 patches.
This patchset is on top of
block/for-4.1/core bfd343aa1718 ("blk-mq: don't wait in blk_mq_queue_enter() if __GFP_WAIT isn't set")
+  [PATCH] writeback: fix possible underflow in write bandwidth calculation
+  [PATCHSET 1/3 v3 block/for-4.1/core] writeback: cgroup writeback support
+  [PATCHSET 2/3 v2 block/for-4.1/core] writeback: cgroup writeback backpressure propagation
and available in the following git branch.
diffstat follows. Thanks.
fs/buffer.c | 26 -
fs/fs-writeback.c | 523 ++++++++++++++++++++++++++++++++++++++-
fs/mpage.c | 3
include/linux/backing-dev-defs.h | 66 ++++
include/linux/backing-dev.h | 142 ++++------
include/linux/fs.h | 11
include/linux/writeback.h | 123 +++++++++
mm/backing-dev.c | 30 --
mm/filemap.c | 2
mm/page-writeback.c | 16 -
mm/truncate.c | 21 -
11 files changed, 821 insertions(+), 142 deletions(-)
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/