Skip to content

Commit

Permalink
Merge branch 'for-3.18' of git://git.kernel.org/pub/scm/linux/kernel/…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
torvalds committed Oct 10, 2014
2 parents d9428f0 + e756c7b commit b211e9d
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 205 deletions.
39 changes: 4 additions & 35 deletions fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,37 +376,6 @@ static const struct file_operations proc_lstats_operations = {

#endif

#ifdef CONFIG_CGROUPS
static int cgroup_open(struct inode *inode, struct file *file)
{
struct pid *pid = PROC_I(inode)->pid;
return single_open(file, proc_cgroup_show, pid);
}

static const struct file_operations proc_cgroup_operations = {
.open = cgroup_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
#endif

#ifdef CONFIG_PROC_PID_CPUSET

static int cpuset_open(struct inode *inode, struct file *file)
{
struct pid *pid = PROC_I(inode)->pid;
return single_open(file, proc_cpuset_show, pid);
}

static const struct file_operations proc_cpuset_operations = {
.open = cpuset_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
#endif

static int proc_oom_score(struct seq_file *m, struct pid_namespace *ns,
struct pid *pid, struct task_struct *task)
{
Expand Down Expand Up @@ -2579,10 +2548,10 @@ static const struct pid_entry tgid_base_stuff[] = {
REG("latency", S_IRUGO, proc_lstats_operations),
#endif
#ifdef CONFIG_PROC_PID_CPUSET
REG("cpuset", S_IRUGO, proc_cpuset_operations),
ONE("cpuset", S_IRUGO, proc_cpuset_show),
#endif
#ifdef CONFIG_CGROUPS
REG("cgroup", S_IRUGO, proc_cgroup_operations),
ONE("cgroup", S_IRUGO, proc_cgroup_show),
#endif
ONE("oom_score", S_IRUGO, proc_oom_score),
REG("oom_adj", S_IRUGO|S_IWUSR, proc_oom_adj_operations),
Expand Down Expand Up @@ -2925,10 +2894,10 @@ static const struct pid_entry tid_base_stuff[] = {
REG("latency", S_IRUGO, proc_lstats_operations),
#endif
#ifdef CONFIG_PROC_PID_CPUSET
REG("cpuset", S_IRUGO, proc_cpuset_operations),
ONE("cpuset", S_IRUGO, proc_cpuset_show),
#endif
#ifdef CONFIG_CGROUPS
REG("cgroup", S_IRUGO, proc_cgroup_operations),
ONE("cgroup", S_IRUGO, proc_cgroup_show),
#endif
ONE("oom_score", S_IRUGO, proc_oom_score),
REG("oom_adj", S_IRUGO|S_IWUSR, proc_oom_adj_operations),
Expand Down
26 changes: 7 additions & 19 deletions include/linux/cgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

struct cgroup_root;
struct cgroup_subsys;
struct inode;
struct cgroup;

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

extern int proc_cgroup_show(struct seq_file *, void *);
extern int proc_cgroup_show(struct seq_file *m, struct pid_namespace *ns,
struct pid *pid, struct task_struct *tsk);

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

/* bits in struct cgroup flags field */
enum {
/*
* Control Group has previously had a child cgroup or a task,
* but no longer (only if CGRP_NOTIFY_ON_RELEASE is set)
*/
CGRP_RELEASABLE,
/* Control Group requires release notifications to userspace */
CGRP_NOTIFY_ON_RELEASE,
/*
Expand Down Expand Up @@ -234,13 +229,6 @@ struct cgroup {
*/
struct list_head e_csets[CGROUP_SUBSYS_COUNT];

/*
* Linked list running through all cgroups that can
* potentially be reaped by the release agent. Protected by
* release_list_lock
*/
struct list_head release_list;

/*
* list of pidlists, up to two for each namespace (one for procs, one
* for tasks); created on demand.
Expand All @@ -250,6 +238,9 @@ struct cgroup {

/* used to wait for offlining of csses */
wait_queue_head_t offline_waitq;

/* used to schedule release agent */
struct work_struct release_agent_work;
};

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

/* returns ino associated with a cgroup, 0 indicates unmounted root */
/* returns ino associated with a cgroup */
static inline ino_t cgroup_ino(struct cgroup *cgrp)
{
if (cgrp->kn)
return cgrp->kn->ino;
else
return 0;
return cgrp->kn->ino;
}

/* cft/css accessors for cftype->write() operation */
Expand Down
3 changes: 2 additions & 1 deletion include/linux/cpuset.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ extern void __cpuset_memory_pressure_bump(void);

extern void cpuset_task_status_allowed(struct seq_file *m,
struct task_struct *task);
extern int proc_cpuset_show(struct seq_file *, void *);
extern int proc_cpuset_show(struct seq_file *m, struct pid_namespace *ns,
struct pid *pid, struct task_struct *tsk);

extern int cpuset_mem_spread_node(void);
extern int cpuset_slab_spread_node(void);
Expand Down
Loading

0 comments on commit b211e9d

Please sign in to comment.