aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cgroup.h
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /include/linux/cgroup.h
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r--include/linux/cgroup.h29
1 files changed, 17 insertions, 12 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 0c991023ee47..ab4ac0ccb857 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -75,7 +75,7 @@ struct cgroup_subsys_state {
75 75
76 unsigned long flags; 76 unsigned long flags;
77 /* ID for this css, if possible */ 77 /* ID for this css, if possible */
78 struct css_id *id; 78 struct css_id __rcu *id;
79}; 79};
80 80
81/* bits in struct cgroup_subsys_state flags field */ 81/* bits in struct cgroup_subsys_state flags field */
@@ -154,6 +154,10 @@ enum {
154 * A thread in rmdir() is wating for this cgroup. 154 * A thread in rmdir() is wating for this cgroup.
155 */ 155 */
156 CGRP_WAIT_ON_RMDIR, 156 CGRP_WAIT_ON_RMDIR,
157 /*
158 * Clone cgroup values when creating a new child cgroup
159 */
160 CGRP_CLONE_CHILDREN,
157}; 161};
158 162
159/* which pidlist file are we talking about? */ 163/* which pidlist file are we talking about? */
@@ -205,7 +209,7 @@ struct cgroup {
205 struct list_head children; /* my children */ 209 struct list_head children; /* my children */
206 210
207 struct cgroup *parent; /* my parent */ 211 struct cgroup *parent; /* my parent */
208 struct dentry *dentry; /* cgroup fs entry, RCU protected */ 212 struct dentry __rcu *dentry; /* cgroup fs entry, RCU protected */
209 213
210 /* Private pointers for each registered subsystem */ 214 /* Private pointers for each registered subsystem */
211 struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; 215 struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT];
@@ -236,7 +240,7 @@ struct cgroup {
236 /* For RCU-protected deletion */ 240 /* For RCU-protected deletion */
237 struct rcu_head rcu_head; 241 struct rcu_head rcu_head;
238 242
239 /* List of events which userspace want to recieve */ 243 /* List of events which userspace want to receive */
240 struct list_head event_list; 244 struct list_head event_list;
241 spinlock_t event_list_lock; 245 spinlock_t event_list_lock;
242}; 246};
@@ -463,14 +467,17 @@ struct cgroup_subsys {
463 int (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); 467 int (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp);
464 void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); 468 void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp);
465 int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, 469 int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
466 struct task_struct *tsk, bool threadgroup); 470 struct task_struct *tsk);
471 int (*can_attach_task)(struct cgroup *cgrp, struct task_struct *tsk);
467 void (*cancel_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, 472 void (*cancel_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
468 struct task_struct *tsk, bool threadgroup); 473 struct task_struct *tsk);
474 void (*pre_attach)(struct cgroup *cgrp);
475 void (*attach_task)(struct cgroup *cgrp, struct task_struct *tsk);
469 void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, 476 void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
470 struct cgroup *old_cgrp, struct task_struct *tsk, 477 struct cgroup *old_cgrp, struct task_struct *tsk);
471 bool threadgroup);
472 void (*fork)(struct cgroup_subsys *ss, struct task_struct *task); 478 void (*fork)(struct cgroup_subsys *ss, struct task_struct *task);
473 void (*exit)(struct cgroup_subsys *ss, struct task_struct *task); 479 void (*exit)(struct cgroup_subsys *ss, struct cgroup *cgrp,
480 struct cgroup *old_cgrp, struct task_struct *task);
474 int (*populate)(struct cgroup_subsys *ss, 481 int (*populate)(struct cgroup_subsys *ss,
475 struct cgroup *cgrp); 482 struct cgroup *cgrp);
476 void (*post_clone)(struct cgroup_subsys *ss, struct cgroup *cgrp); 483 void (*post_clone)(struct cgroup_subsys *ss, struct cgroup *cgrp);
@@ -548,9 +555,6 @@ static inline struct cgroup* task_cgroup(struct task_struct *task,
548 return task_subsys_state(task, subsys_id)->cgroup; 555 return task_subsys_state(task, subsys_id)->cgroup;
549} 556}
550 557
551int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *ss,
552 char *nodename);
553
554/* A cgroup_iter should be treated as an opaque object */ 558/* A cgroup_iter should be treated as an opaque object */
555struct cgroup_iter { 559struct cgroup_iter {
556 struct list_head *cg_link; 560 struct list_head *cg_link;
@@ -560,7 +564,7 @@ struct cgroup_iter {
560/* 564/*
561 * To iterate across the tasks in a cgroup: 565 * To iterate across the tasks in a cgroup:
562 * 566 *
563 * 1) call cgroup_iter_start to intialize an iterator 567 * 1) call cgroup_iter_start to initialize an iterator
564 * 568 *
565 * 2) call cgroup_iter_next() to retrieve member tasks until it 569 * 2) call cgroup_iter_next() to retrieve member tasks until it
566 * returns NULL or until you want to end the iteration 570 * returns NULL or until you want to end the iteration
@@ -622,6 +626,7 @@ bool css_is_ancestor(struct cgroup_subsys_state *cg,
622/* Get id and depth of css */ 626/* Get id and depth of css */
623unsigned short css_id(struct cgroup_subsys_state *css); 627unsigned short css_id(struct cgroup_subsys_state *css);
624unsigned short css_depth(struct cgroup_subsys_state *css); 628unsigned short css_depth(struct cgroup_subsys_state *css);
629struct cgroup_subsys_state *cgroup_css_from_dir(struct file *f, int id);
625 630
626#else /* !CONFIG_CGROUPS */ 631#else /* !CONFIG_CGROUPS */
627 632