Skip to content

Commit b211e9d

Browse files
committed
Merge branch 'for-3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
Pull cgroup updates from Tejun Heo: "Nothing too interesting. Just a handful of cleanup patches" * 'for-3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: Revert "cgroup: remove redundant variable in cgroup_mount()" cgroup: remove redundant variable in cgroup_mount() cgroup: fix missing unlock in cgroup_release_agent() cgroup: remove CGRP_RELEASABLE flag perf/cgroup: Remove perf_put_cgroup() cgroup: remove redundant check in cgroup_ino() cpuset: simplify proc_cpuset_show() cgroup: simplify proc_cgroup_show() cgroup: use a per-cgroup work for release agent cgroup: remove bogus comments cgroup: remove redundant code in cgroup_rmdir() cgroup: remove some useless forward declarations cgroup: fix a typo in comment.
2 parents d9428f0 + e756c7b commit b211e9d

7 files changed

Lines changed: 71 additions & 205 deletions

File tree

‎fs/proc/base.c‎

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -376,37 +376,6 @@ static const struct file_operations proc_lstats_operations = {
376376

377377
#endif
378378

379-
#ifdef CONFIG_CGROUPS
380-
static int cgroup_open(struct inode *inode, struct file *file)
381-
{
382-
struct pid *pid = PROC_I(inode)->pid;
383-
return single_open(file, proc_cgroup_show, pid);
384-
}
385-
386-
static const struct file_operations proc_cgroup_operations = {
387-
.open = cgroup_open,
388-
.read = seq_read,
389-
.llseek = seq_lseek,
390-
.release = single_release,
391-
};
392-
#endif
393-
394-
#ifdef CONFIG_PROC_PID_CPUSET
395-
396-
static int cpuset_open(struct inode *inode, struct file *file)
397-
{
398-
struct pid *pid = PROC_I(inode)->pid;
399-
return single_open(file, proc_cpuset_show, pid);
400-
}
401-
402-
static const struct file_operations proc_cpuset_operations = {
403-
.open = cpuset_open,
404-
.read = seq_read,
405-
.llseek = seq_lseek,
406-
.release = single_release,
407-
};
408-
#endif
409-
410379
static int proc_oom_score(struct seq_file *m, struct pid_namespace *ns,
411380
struct pid *pid, struct task_struct *task)
412381
{
@@ -2579,10 +2548,10 @@ static const struct pid_entry tgid_base_stuff[] = {
25792548
REG("latency", S_IRUGO, proc_lstats_operations),
25802549
#endif
25812550
#ifdef CONFIG_PROC_PID_CPUSET
2582-
REG("cpuset", S_IRUGO, proc_cpuset_operations),
2551+
ONE("cpuset", S_IRUGO, proc_cpuset_show),
25832552
#endif
25842553
#ifdef CONFIG_CGROUPS
2585-
REG("cgroup", S_IRUGO, proc_cgroup_operations),
2554+
ONE("cgroup", S_IRUGO, proc_cgroup_show),
25862555
#endif
25872556
ONE("oom_score", S_IRUGO, proc_oom_score),
25882557
REG("oom_adj", S_IRUGO|S_IWUSR, proc_oom_adj_operations),
@@ -2925,10 +2894,10 @@ static const struct pid_entry tid_base_stuff[] = {
29252894
REG("latency", S_IRUGO, proc_lstats_operations),
29262895
#endif
29272896
#ifdef CONFIG_PROC_PID_CPUSET
2928-
REG("cpuset", S_IRUGO, proc_cpuset_operations),
2897+
ONE("cpuset", S_IRUGO, proc_cpuset_show),
29292898
#endif
29302899
#ifdef CONFIG_CGROUPS
2931-
REG("cgroup", S_IRUGO, proc_cgroup_operations),
2900+
ONE("cgroup", S_IRUGO, proc_cgroup_show),
29322901
#endif
29332902
ONE("oom_score", S_IRUGO, proc_oom_score),
29342903
REG("oom_adj", S_IRUGO|S_IWUSR, proc_oom_adj_operations),

‎include/linux/cgroup.h‎

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
struct cgroup_root;
2929
struct cgroup_subsys;
30-
struct inode;
3130
struct cgroup;
3231

3332
extern int cgroup_init_early(void);
@@ -38,7 +37,8 @@ extern void cgroup_exit(struct task_struct *p);
3837
extern int cgroupstats_build(struct cgroupstats *stats,
3938
struct dentry *dentry);
4039

41-
extern int proc_cgroup_show(struct seq_file *, void *);
40+
extern int proc_cgroup_show(struct seq_file *m, struct pid_namespace *ns,
41+
struct pid *pid, struct task_struct *tsk);
4242

4343
/* define the enumeration of all cgroup subsystems */
4444
#define SUBSYS(_x) _x ## _cgrp_id,
@@ -161,11 +161,6 @@ static inline void css_put(struct cgroup_subsys_state *css)
161161

162162
/* bits in struct cgroup flags field */
163163
enum {
164-
/*
165-
* Control Group has previously had a child cgroup or a task,
166-
* but no longer (only if CGRP_NOTIFY_ON_RELEASE is set)
167-
*/
168-
CGRP_RELEASABLE,
169164
/* Control Group requires release notifications to userspace */
170165
CGRP_NOTIFY_ON_RELEASE,
171166
/*
@@ -234,13 +229,6 @@ struct cgroup {
234229
*/
235230
struct list_head e_csets[CGROUP_SUBSYS_COUNT];
236231

237-
/*
238-
* Linked list running through all cgroups that can
239-
* potentially be reaped by the release agent. Protected by
240-
* release_list_lock
241-
*/
242-
struct list_head release_list;
243-
244232
/*
245233
* list of pidlists, up to two for each namespace (one for procs, one
246234
* for tasks); created on demand.
@@ -250,6 +238,9 @@ struct cgroup {
250238

251239
/* used to wait for offlining of csses */
252240
wait_queue_head_t offline_waitq;
241+
242+
/* used to schedule release agent */
243+
struct work_struct release_agent_work;
253244
};
254245

255246
#define MAX_CGROUP_ROOT_NAMELEN 64
@@ -536,13 +527,10 @@ static inline bool cgroup_has_tasks(struct cgroup *cgrp)
536527
return !list_empty(&cgrp->cset_links);
537528
}
538529

539-
/* returns ino associated with a cgroup, 0 indicates unmounted root */
530+
/* returns ino associated with a cgroup */
540531
static inline ino_t cgroup_ino(struct cgroup *cgrp)
541532
{
542-
if (cgrp->kn)
543-
return cgrp->kn->ino;
544-
else
545-
return 0;
533+
return cgrp->kn->ino;
546534
}
547535

548536
/* cft/css accessors for cftype->write() operation */

‎include/linux/cpuset.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ extern void __cpuset_memory_pressure_bump(void);
8686

8787
extern void cpuset_task_status_allowed(struct seq_file *m,
8888
struct task_struct *task);
89-
extern int proc_cpuset_show(struct seq_file *, void *);
89+
extern int proc_cpuset_show(struct seq_file *m, struct pid_namespace *ns,
90+
struct pid *pid, struct task_struct *tsk);
9091

9192
extern int cpuset_mem_spread_node(void);
9293
extern int cpuset_slab_spread_node(void);

0 commit comments

Comments
 (0)