cgroup, writeback: don't enable cgroup writeback on traditional hierarchies
authorTejun Heo <tj@kernel.org>
Wed, 23 Sep 2015 21:07:29 +0000 (17:07 -0400)
committerTejun Heo <tj@kernel.org>
Thu, 24 Sep 2015 20:48:52 +0000 (16:48 -0400)
commit9badce000e2ce68ba74838a3cd356dde58221c2f
treee23ec4dbe5b23e420ab0138dde80382b544df876
parent0c986253b939cc14c69d4adbe2b4121bdf4aa220
cgroup, writeback: don't enable cgroup writeback on traditional hierarchies

inode_cgwb_enabled() gates cgroup writeback support.  If it returns
true, each inode is attached to the corresponding memory domain which
gets mapped to io domain.  It currently only tests whether the
filesystem and bdi support cgroup writeback; however, cgroup writeback
support doesn't work on traditional hierarchies and thus it should
also test whether memcg and iocg are on the default hierarchy.

This caused traditional hierarchy setups to hit the cgroup writeback
path inadvertently and ended up creating separate writeback domains
for each memcg and mapping them all to the root iocg uncovering a
couple issues in the cgroup writeback path.

cgroup writeback was never meant to be enabled on traditional
hierarchies.  Make inode_cgwb_enabled() test whether both memcg and
iocg are on the default hierarchy.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Artem Bityutskiy <dedekind1@gmail.com>
Reported-by: Dexuan Cui <decui@microsoft.com>
Link: http://lkml.kernel.org/g/1443012552.19983.209.camel@gmail.com
Link: http://lkml.kernel.org/g/f30d4a6aa8a546ff88f73021d026a453@SIXPR30MB031.064d.mgd.msft.net
include/linux/backing-dev.h