summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-20 18:11:21 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-20 18:11:21 -0700
commit0d9cabdccedb79ee5f27b77ff51f29a9e7d23275 (patch)
tree8bfb64c3672d058eb90aec3c3a9c4f61cef9097c /include
parent701085b219016d38f105b031381b9cee6200253a (diff)
parent3ce3230a0cff484e5130153f244d4fb8a56b3a8b (diff)
downloadlinux-3.10-0d9cabdccedb79ee5f27b77ff51f29a9e7d23275.tar.gz
linux-3.10-0d9cabdccedb79ee5f27b77ff51f29a9e7d23275.tar.bz2
linux-3.10-0d9cabdccedb79ee5f27b77ff51f29a9e7d23275.zip
Merge branch 'for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
Pull cgroup changes from Tejun Heo: "Out of the 8 commits, one fixes a long-standing locking issue around tasklist walking and others are cleanups." * 'for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cgroup: Walk task list under tasklist_lock in cgroup_enable_task_cg_list cgroup: Remove wrong comment on cgroup_enable_task_cg_list() cgroup: remove cgroup_subsys argument from callbacks cgroup: remove extra calls to find_existing_css_set cgroup: replace tasklist_lock with rcu_read_lock cgroup: simplify double-check locking in cgroup_attach_proc cgroup: move struct cgroup_pidlist out from the header file cgroup: remove cgroup_attach_task_current_cg()
Diffstat (limited to 'include')
-rw-r--r--include/linux/cgroup.h70
-rw-r--r--include/net/sock.h7
-rw-r--r--include/net/tcp_memcontrol.h2
3 files changed, 16 insertions, 63 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index e9b602151ca..501adb1b2f4 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -160,38 +160,6 @@ enum {
CGRP_CLONE_CHILDREN,
};
-/* which pidlist file are we talking about? */
-enum cgroup_filetype {
- CGROUP_FILE_PROCS,
- CGROUP_FILE_TASKS,
-};
-
-/*
- * A pidlist is a list of pids that virtually represents the contents of one
- * of the cgroup files ("procs" or "tasks"). We keep a list of such pidlists,
- * a pair (one each for procs, tasks) for each pid namespace that's relevant
- * to the cgroup.
- */
-struct cgroup_pidlist {
- /*
- * used to find which pidlist is wanted. doesn't change as long as
- * this particular list stays in the list.
- */
- struct { enum cgroup_filetype type; struct pid_namespace *ns; } key;
- /* array of xids */
- pid_t *list;
- /* how many elements the above list has */
- int length;
- /* how many files are using the current array */
- int use_count;
- /* each of these stored in a list by its cgroup */
- struct list_head links;
- /* pointer to the cgroup we belong to, for list removal purposes */
- struct cgroup *owner;
- /* protects the other fields */
- struct rw_semaphore mutex;
-};
-
struct cgroup {
unsigned long flags; /* "unsigned long" so bitops work */
@@ -484,23 +452,18 @@ int cgroup_taskset_size(struct cgroup_taskset *tset);
*/
struct cgroup_subsys {
- struct cgroup_subsys_state *(*create)(struct cgroup_subsys *ss,
- struct cgroup *cgrp);
- int (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp);
- void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp);
- int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
- struct cgroup_taskset *tset);
- void (*cancel_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
- struct cgroup_taskset *tset);
- void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
- struct cgroup_taskset *tset);
- void (*fork)(struct cgroup_subsys *ss, struct task_struct *task);
- void (*exit)(struct cgroup_subsys *ss, struct cgroup *cgrp,
- struct cgroup *old_cgrp, struct task_struct *task);
- int (*populate)(struct cgroup_subsys *ss,
- struct cgroup *cgrp);
- void (*post_clone)(struct cgroup_subsys *ss, struct cgroup *cgrp);
- void (*bind)(struct cgroup_subsys *ss, struct cgroup *root);
+ struct cgroup_subsys_state *(*create)(struct cgroup *cgrp);
+ int (*pre_destroy)(struct cgroup *cgrp);
+ void (*destroy)(struct cgroup *cgrp);
+ int (*can_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset);
+ void (*cancel_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset);
+ void (*attach)(struct cgroup *cgrp, struct cgroup_taskset *tset);
+ void (*fork)(struct task_struct *task);
+ void (*exit)(struct cgroup *cgrp, struct cgroup *old_cgrp,
+ struct task_struct *task);
+ int (*populate)(struct cgroup_subsys *ss, struct cgroup *cgrp);
+ void (*post_clone)(struct cgroup *cgrp);
+ void (*bind)(struct cgroup *root);
int subsys_id;
int active;
@@ -602,11 +565,6 @@ int cgroup_scan_tasks(struct cgroup_scanner *scan);
int cgroup_attach_task(struct cgroup *, struct task_struct *);
int cgroup_attach_task_all(struct task_struct *from, struct task_struct *);
-static inline int cgroup_attach_task_current_cg(struct task_struct *tsk)
-{
- return cgroup_attach_task_all(current, tsk);
-}
-
/*
* CSS ID is ID for cgroup_subsys_state structs under subsys. This only works
* if cgroup_subsys.use_id == true. It can be used for looking up and scanning.
@@ -669,10 +627,6 @@ static inline int cgroup_attach_task_all(struct task_struct *from,
{
return 0;
}
-static inline int cgroup_attach_task_current_cg(struct task_struct *t)
-{
- return 0;
-}
#endif /* !CONFIG_CGROUPS */
diff --git a/include/net/sock.h b/include/net/sock.h
index dcde2d9268c..7ef5c58f3f4 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -69,7 +69,7 @@ struct cgroup;
struct cgroup_subsys;
#ifdef CONFIG_NET
int mem_cgroup_sockets_init(struct cgroup *cgrp, struct cgroup_subsys *ss);
-void mem_cgroup_sockets_destroy(struct cgroup *cgrp, struct cgroup_subsys *ss);
+void mem_cgroup_sockets_destroy(struct cgroup *cgrp);
#else
static inline
int mem_cgroup_sockets_init(struct cgroup *cgrp, struct cgroup_subsys *ss)
@@ -77,7 +77,7 @@ int mem_cgroup_sockets_init(struct cgroup *cgrp, struct cgroup_subsys *ss)
return 0;
}
static inline
-void mem_cgroup_sockets_destroy(struct cgroup *cgrp, struct cgroup_subsys *ss)
+void mem_cgroup_sockets_destroy(struct cgroup *cgrp)
{
}
#endif
@@ -871,8 +871,7 @@ struct proto {
*/
int (*init_cgroup)(struct cgroup *cgrp,
struct cgroup_subsys *ss);
- void (*destroy_cgroup)(struct cgroup *cgrp,
- struct cgroup_subsys *ss);
+ void (*destroy_cgroup)(struct cgroup *cgrp);
struct cg_proto *(*proto_cgroup)(struct mem_cgroup *memcg);
#endif
};
diff --git a/include/net/tcp_memcontrol.h b/include/net/tcp_memcontrol.h
index 3512082fa90..48410ff25c9 100644
--- a/include/net/tcp_memcontrol.h
+++ b/include/net/tcp_memcontrol.h
@@ -13,7 +13,7 @@ struct tcp_memcontrol {
struct cg_proto *tcp_proto_cgroup(struct mem_cgroup *memcg);
int tcp_init_cgroup(struct cgroup *cgrp, struct cgroup_subsys *ss);
-void tcp_destroy_cgroup(struct cgroup *cgrp, struct cgroup_subsys *ss);
+void tcp_destroy_cgroup(struct cgroup *cgrp);
unsigned long long tcp_max_memory(const struct mem_cgroup *memcg);
void tcp_prot_mem(struct mem_cgroup *memcg, long val, int idx);
#endif /* _TCP_MEMCG_H */