aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/backing-dev.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2015-09-24 16:59:19 -0400
committerTejun Heo <tj@kernel.org>2015-09-24 16:59:19 -0400
commitc0522908d22e0b8669e01a7706720996c773e7f4 (patch)
tree2588f61e502038b87e13113fadd01cf2f0b4320a /include/linux/backing-dev.h
parentcgroup: make cgroup_update_dfl_csses() migrate all target processes atomically (diff)
parentcgroup, writeback: don't enable cgroup writeback on traditional hierarchies (diff)
downloadlinux-dev-c0522908d22e0b8669e01a7706720996c773e7f4.tar.xz
linux-dev-c0522908d22e0b8669e01a7706720996c773e7f4.zip
cgroup: Merge branch 'for-4.3-fixes' into for-4.4
Pull to receive 9badce000e2c ("cgroup, writeback: don't enable cgroup writeback on traditional hierarchies"). The commit adds cgroup_on_dfl() usages in include/linux/backing-dev.h thus causing a silent conflict with 9e10a130d9b6 ("cgroup: replace cgroup_on_dfl() tests in controllers with cgroup_subsys_on_dfl()"). The conflict is fixed during this merge. Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux/backing-dev.h')
-rw-r--r--include/linux/backing-dev.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index 5a5d79ee256f..08d9a8eac42c 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -252,13 +252,19 @@ int inode_congested(struct inode *inode, int cong_bits);
* @inode: inode of interest
*
* cgroup writeback requires support from both the bdi and filesystem.
- * Test whether @inode has both.
+ * Also, both memcg and iocg have to be on the default hierarchy. Test
+ * whether all conditions are met.
+ *
+ * Note that the test result may change dynamically on the same inode
+ * depending on how memcg and iocg are configured.
*/
static inline bool inode_cgwb_enabled(struct inode *inode)
{
struct backing_dev_info *bdi = inode_to_bdi(inode);
- return bdi_cap_account_dirty(bdi) &&
+ return cgroup_subsys_on_dfl(memory_cgrp_subsys) &&
+ cgroup_subsys_on_dfl(io_cgrp_subsys) &&
+ bdi_cap_account_dirty(bdi) &&
(bdi->capabilities & BDI_CAP_CGROUP_WRITEBACK) &&
(inode->i_sb->s_iflags & SB_I_CGROUPWB);
}