Skip to contentSkip to conversation

cgroup: reorder SUBSYS(blkio) in cgroup_subsys.h

PATCH In review Tejun Heo 2 participants 4 messages Jan 6, 2015 – Jan 7, 2015 cgroup

lore
Share & tools
lore

Tejun Heo

author maintainer
#0 lore raw

PATCH 1/2 cgroup: reorder SUBSYS(blkio) in cgroup_subsys.h

The scheduled cgroup writeback support requires blkio to be initialized before memcg as memcg needs to provide certain blkcg related functionalities. Relocate blkio so that it's right above memory.

---
Hello,

These are two trivial patches to prepare for the cgroup writeback support. Applying to cgroup/for-3.20.

Thanks.

 include/linux/cgroup_subsys.h |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
include/linux/cgroup_subsys.h +4 -4
@@ -15,6 +15,10 @@ SUBSYS(cpu)
 SUBSYS(cpuacct)
 #endif
 
+#if IS_ENABLED(CONFIG_BLK_CGROUP)
+SUBSYS(blkio)
+#endif
+
 #if IS_ENABLED(CONFIG_MEMCG)
 SUBSYS(memory)
 #endif
@@ -31,10 +35,6 @@ SUBSYS(freezer)
 SUBSYS(net_cls)
 #endif
 
-#if IS_ENABLED(CONFIG_BLK_CGROUP)
-SUBSYS(blkio)
-#endif
-
 #if IS_ENABLED(CONFIG_CGROUP_PERF)
 SUBSYS(perf_event)
 #endif
author maintainer
#1 lore raw

PATCH 2/2 cgroup: add dummy css_put() for !CONFIG_CGROUPS

This will later be depended upon by the scheduled cgroup writeback support.

---
 include/linux/cgroup.h |    4 ++++
 1 file changed, 4 insertions(+)
include/linux/cgroup.h +4 -0
@@ -943,6 +943,8 @@ struct cgroup_subsys_state *css_tryget_o
 
 #else /* !CONFIG_CGROUPS */
 
+struct cgroup_subsys_state;
+
 static inline int cgroup_init_early(void) { return 0; }
 static inline int cgroup_init(void) { return 0; }
 static inline void cgroup_fork(struct task_struct *p) {}
@@ -955,6 +957,8 @@ static inline int cgroupstats_build(stru
 	return -EINVAL;
 }
 
+static inline void css_put(struct cgroup_subsys_state *css) {}
+
 /* No cgroups - nothing to do */
 static inline int cgroup_attach_task_all(struct task_struct *from,
 					 struct task_struct *t)
Acked-by on v1 1/2
#3 lore raw
In reply to Tejun Heo
Quoted 5 lines · Tejun Heo

The scheduled cgroup writeback support requires blkio to be initialized before memcg as memcg needs to provide certain blkcg related functionalities. Relocate blkio so that it's right above memory.

Quoted 7 lines

---
Hello,

These are two trivial patches to prepare for the cgroup writeback support. Applying to cgroup/for-3.20.