diff options
author | Tejun Heo <tj@kernel.org> | 2015-07-21 23:51:26 -0400 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2016-03-01 18:54:36 +0800 |
commit | 433c4cf26fee51b16ead60e763caf537a4a23ef6 (patch) | |
tree | 73eaa1eada3867416b2f0fb6f6dddb9a2f24502e /fs/ext4/super.c | |
parent | e5f418f0226a71194c0856ff5e264673db6fb319 (diff) |
ext4: implement cgroup writeback support
For ordered and writeback data modes, all data IOs go through
ext4_io_submit. This patch adds cgroup writeback support by invoking
wbc_init_bio() from io_submit_init_bio() and wbc_account_io() in
io_submit_add_bh(). Journal data which is written by jbd2 worker is
left alone by this patch and will always be written out from the root
cgroup.
ext4_fill_super() is updated to set MS_CGROUPWB when data mode is
either ordered or writeback. In journaled data mode, most IOs become
synchronous through the journal and enabling cgroup writeback support
doesn't make much sense or difference. Journaled data mode is left
alone.
Lightly tested with sequential data write workload. Behaves as
expected.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
(cherry picked from commit 001e4a8775f6e8ad52a89e0072f09aee47d5d252)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 95194fb84140..8589e2c543ce 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3625,6 +3625,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) } if (test_opt(sb, DELALLOC)) clear_opt(sb, DELALLOC); + } else { + sb->s_iflags |= SB_I_CGROUPWB; } sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | |