]> git.pld-linux.org Git - packages/kernel.git/blame - kernel-small_fixes.patch
- rel 2; add cgroup writeback suport for xfs (not merged by upstream only due to...
[packages/kernel.git] / kernel-small_fixes.patch
CommitLineData
5da6072d
AM
1From: Shaohua Li <shli@fb.com>
2
3Basically this is a copy of commit 001e4a8775f6(ext4: implement cgroup
4writeback support). Tested with a fio test, verified writeback is
5throttled against cgroup io.max write bandwidth, also verified moving
6the fio test to another cgroup and the writeback is throttled against
7new cgroup setting.
8
9Cc: Tejun Heo <tj@kernel.org>
10Signed-off-by: Shaohua Li <shli@fb.com>
11---
12 fs/xfs/xfs_aops.c | 2 ++
13 fs/xfs/xfs_super.c | 1 +
14 2 files changed, 3 insertions(+)
15
16diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
17index f18e593..6535054 100644
18--- a/fs/xfs/xfs_aops.c
19+++ b/fs/xfs/xfs_aops.c
20@@ -613,8 +613,10 @@ xfs_add_to_ioend(
21 list_add(&wpc->ioend->io_list, iolist);
22 wpc->ioend = xfs_alloc_ioend(inode, wpc->io_type, offset,
23 bdev, sector);
24+ wbc_init_bio(wbc, wpc->ioend->io_bio);
25 }
26
27+ wbc_account_io(wbc, bh->b_page, bh->b_size);
28 if (!__bio_try_merge_page(wpc->ioend->io_bio, page, len, poff)) {
29 if (iop)
30 atomic_inc(&iop->write_count);
31diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
32index 584cf2d..aea3bc2 100644
33--- a/fs/xfs/xfs_super.c
34+++ b/fs/xfs/xfs_super.c
35@@ -1634,6 +1634,7 @@ xfs_fs_fill_super(
36 sb->s_max_links = XFS_MAXLINK;
37 sb->s_time_gran = 1;
38 set_posix_acl_flag(sb);
39+ sb->s_iflags |= SB_I_CGROUPWB;
40
41 /* version 5 superblocks support inode version counters. */
42 if (XFS_SB_VERSION_NUM(&mp->m_sb) == XFS_SB_VERSION_5)
This page took 0.031564 seconds and 4 git commands to generate.