Skip to content

Commit

Permalink
Merge branch 'for-4.3-fixes' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/tj/cgroup

Pull another cgroup fix from Tejun Heo:
 "The cgroup writeback support got inadvertently enabled for traditional
  hierarchies revealing two regressions which are currently being worked
  on.  It shouldn't have been enabled on traditional hierarchies, so
  disable it on them.  This is enough to make the regressions go away
  for people who aren't experimenting with cgroup"

* 'for-4.3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
  cgroup, writeback: don't enable cgroup writeback on traditional hierarchies
  • Loading branch information
Linus Torvalds committed Sep 25, 2015
2 parents 03e8f64 + 9badce0 commit d4a748a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions include/linux/backing-dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <linux/sched.h>
#include <linux/blkdev.h>
#include <linux/writeback.h>
#include <linux/memcontrol.h>
#include <linux/blk-cgroup.h>
#include <linux/backing-dev-defs.h>
#include <linux/slab.h>
Expand Down Expand Up @@ -252,13 +253,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_on_dfl(mem_cgroup_root_css->cgroup) &&
cgroup_on_dfl(blkcg_root_css->cgroup) &&
bdi_cap_account_dirty(bdi) &&
(bdi->capabilities & BDI_CAP_CGROUP_WRITEBACK) &&
(inode->i_sb->s_iflags & SB_I_CGROUPWB);
}
Expand Down

0 comments on commit d4a748a

Please sign in to comment.