summaryrefslogtreecommitdiffstats
path: root/kernel/cgroup.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2015-09-18 17:54:22 -0400
committerTejun Heo <tj@kernel.org>2015-09-18 17:54:22 -0400
commit4a07c222d3afb00e1113834fee38d23a8e5d71dc (patch)
tree10000327cd4426ba55b75b5c9d8954a8bd0bf2a5 /kernel/cgroup.c
parent9e10a130d9b62af976d17d120c95f3650769312c (diff)
downloadlinux-4a07c222d3afb00e1113834fee38d23a8e5d71dc.tar.bz2
cgroup: replace "cgroup.populated" with "cgroup.events"
memcg already uses "memory.events" for event reporting and other controllers may need event reporting too. Let's standardize on "$SUBSYS.events" interface file for reporting events which don't happen too frequently and thus can share event notification. "cgroup.populated" is replaced with "populated" field in "cgroup.events" and documentation is updated accordingly. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Li Zefan <lizefan@huawei.com> Cc: Johannes Weiner <hannes@cmpxchg.org>
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r--kernel/cgroup.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index c24f929fdeb7..75eba25d8dfd 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -611,8 +611,8 @@ static void cgroup_update_populated(struct cgroup *cgrp, bool populated)
if (!trigger)
break;
- if (cgrp->populated_kn)
- kernfs_notify(cgrp->populated_kn);
+ if (cgrp->events_kn)
+ kernfs_notify(cgrp->events_kn);
cgrp = cgroup_parent(cgrp);
} while (cgrp);
}
@@ -3045,9 +3045,10 @@ err_undo_css:
goto out_unlock;
}
-static int cgroup_populated_show(struct seq_file *seq, void *v)
+static int cgroup_events_show(struct seq_file *seq, void *v)
{
- seq_printf(seq, "%d\n", (bool)seq_css(seq)->cgroup->populated_cnt);
+ seq_printf(seq, "populated %d\n",
+ (bool)seq_css(seq)->cgroup->populated_cnt);
return 0;
}
@@ -3214,8 +3215,8 @@ static int cgroup_add_file(struct cgroup *cgrp, struct cftype *cft)
if (cft->write == cgroup_procs_write)
cgrp->procs_kn = kn;
- else if (cft->seq_show == cgroup_populated_show)
- cgrp->populated_kn = kn;
+ else if (cft->seq_show == cgroup_events_show)
+ cgrp->events_kn = kn;
return 0;
}
@@ -4388,9 +4389,9 @@ static struct cftype cgroup_dfl_base_files[] = {
.write = cgroup_subtree_control_write,
},
{
- .name = "cgroup.populated",
+ .name = "cgroup.events",
.flags = CFTYPE_NOT_ON_ROOT,
- .seq_show = cgroup_populated_show,
+ .seq_show = cgroup_events_show,
},
{ } /* terminate */
};