aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cgroup.c10
-rw-r--r--kernel/cgroup_freezer.c11
-rw-r--r--kernel/cpuset.c31
-rw-r--r--kernel/sched/core.c16
4 files changed, 20 insertions, 48 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 66c1e3b5c0f2..835ae29e4ea2 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -5349,19 +5349,15 @@ static struct cftype debug_files[] = {
5349 .name = "releasable", 5349 .name = "releasable",
5350 .read_u64 = releasable_read, 5350 .read_u64 = releasable_read,
5351 }, 5351 },
5352};
5353 5352
5354static int debug_populate(struct cgroup_subsys *ss, struct cgroup *cont) 5353 { } /* terminate */
5355{ 5354};
5356 return cgroup_add_files(cont, ss, debug_files,
5357 ARRAY_SIZE(debug_files));
5358}
5359 5355
5360struct cgroup_subsys debug_subsys = { 5356struct cgroup_subsys debug_subsys = {
5361 .name = "debug", 5357 .name = "debug",
5362 .create = debug_create, 5358 .create = debug_create,
5363 .destroy = debug_destroy, 5359 .destroy = debug_destroy,
5364 .populate = debug_populate,
5365 .subsys_id = debug_subsys_id, 5360 .subsys_id = debug_subsys_id,
5361 .base_cftypes = debug_files,
5366}; 5362};
5367#endif /* CONFIG_CGROUP_DEBUG */ 5363#endif /* CONFIG_CGROUP_DEBUG */
diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
index f86e93920b62..3649fc6b3eaa 100644
--- a/kernel/cgroup_freezer.c
+++ b/kernel/cgroup_freezer.c
@@ -358,24 +358,19 @@ static int freezer_write(struct cgroup *cgroup,
358static struct cftype files[] = { 358static struct cftype files[] = {
359 { 359 {
360 .name = "state", 360 .name = "state",
361 .flags = CFTYPE_NOT_ON_ROOT,
361 .read_seq_string = freezer_read, 362 .read_seq_string = freezer_read,
362 .write_string = freezer_write, 363 .write_string = freezer_write,
363 }, 364 },
365 { } /* terminate */
364}; 366};
365 367
366static int freezer_populate(struct cgroup_subsys *ss, struct cgroup *cgroup)
367{
368 if (!cgroup->parent)
369 return 0;
370 return cgroup_add_files(cgroup, ss, files, ARRAY_SIZE(files));
371}
372
373struct cgroup_subsys freezer_subsys = { 368struct cgroup_subsys freezer_subsys = {
374 .name = "freezer", 369 .name = "freezer",
375 .create = freezer_create, 370 .create = freezer_create,
376 .destroy = freezer_destroy, 371 .destroy = freezer_destroy,
377 .populate = freezer_populate,
378 .subsys_id = freezer_subsys_id, 372 .subsys_id = freezer_subsys_id,
379 .can_attach = freezer_can_attach, 373 .can_attach = freezer_can_attach,
380 .fork = freezer_fork, 374 .fork = freezer_fork,
375 .base_cftypes = files,
381}; 376};
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index b96ad75b7e64..2382683617a3 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -1765,28 +1765,17 @@ static struct cftype files[] = {
1765 .write_u64 = cpuset_write_u64, 1765 .write_u64 = cpuset_write_u64,
1766 .private = FILE_SPREAD_SLAB, 1766 .private = FILE_SPREAD_SLAB,
1767 }, 1767 },
1768};
1769
1770static struct cftype cft_memory_pressure_enabled = {
1771 .name = "memory_pressure_enabled",
1772 .read_u64 = cpuset_read_u64,
1773 .write_u64 = cpuset_write_u64,
1774 .private = FILE_MEMORY_PRESSURE_ENABLED,
1775};
1776 1768
1777static int cpuset_populate(struct cgroup_subsys *ss, struct cgroup *cont) 1769 {
1778{ 1770 .name = "memory_pressure_enabled",
1779 int err; 1771 .flags = CFTYPE_ONLY_ON_ROOT,
1772 .read_u64 = cpuset_read_u64,
1773 .write_u64 = cpuset_write_u64,
1774 .private = FILE_MEMORY_PRESSURE_ENABLED,
1775 },
1780 1776
1781 err = cgroup_add_files(cont, ss, files, ARRAY_SIZE(files)); 1777 { } /* terminate */
1782 if (err) 1778};
1783 return err;
1784 /* memory_pressure_enabled is in root cpuset only */
1785 if (!cont->parent)
1786 err = cgroup_add_file(cont, ss,
1787 &cft_memory_pressure_enabled);
1788 return err;
1789}
1790 1779
1791/* 1780/*
1792 * post_clone() is called during cgroup_create() when the 1781 * post_clone() is called during cgroup_create() when the
@@ -1887,9 +1876,9 @@ struct cgroup_subsys cpuset_subsys = {
1887 .destroy = cpuset_destroy, 1876 .destroy = cpuset_destroy,
1888 .can_attach = cpuset_can_attach, 1877 .can_attach = cpuset_can_attach,
1889 .attach = cpuset_attach, 1878 .attach = cpuset_attach,
1890 .populate = cpuset_populate,
1891 .post_clone = cpuset_post_clone, 1879 .post_clone = cpuset_post_clone,
1892 .subsys_id = cpuset_subsys_id, 1880 .subsys_id = cpuset_subsys_id,
1881 .base_cftypes = files,
1893 .early_init = 1, 1882 .early_init = 1,
1894}; 1883};
1895 1884
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 4603b9d8f30a..afc6d7e71557 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -7970,13 +7970,9 @@ static struct cftype cpu_files[] = {
7970 .write_u64 = cpu_rt_period_write_uint, 7970 .write_u64 = cpu_rt_period_write_uint,
7971 }, 7971 },
7972#endif 7972#endif
7973 { } /* terminate */
7973}; 7974};
7974 7975
7975static int cpu_cgroup_populate(struct cgroup_subsys *ss, struct cgroup *cont)
7976{
7977 return cgroup_add_files(cont, ss, cpu_files, ARRAY_SIZE(cpu_files));
7978}
7979
7980struct cgroup_subsys cpu_cgroup_subsys = { 7976struct cgroup_subsys cpu_cgroup_subsys = {
7981 .name = "cpu", 7977 .name = "cpu",
7982 .create = cpu_cgroup_create, 7978 .create = cpu_cgroup_create,
@@ -7984,8 +7980,8 @@ struct cgroup_subsys cpu_cgroup_subsys = {
7984 .can_attach = cpu_cgroup_can_attach, 7980 .can_attach = cpu_cgroup_can_attach,
7985 .attach = cpu_cgroup_attach, 7981 .attach = cpu_cgroup_attach,
7986 .exit = cpu_cgroup_exit, 7982 .exit = cpu_cgroup_exit,
7987 .populate = cpu_cgroup_populate,
7988 .subsys_id = cpu_cgroup_subsys_id, 7983 .subsys_id = cpu_cgroup_subsys_id,
7984 .base_cftypes = cpu_files,
7989 .early_init = 1, 7985 .early_init = 1,
7990}; 7986};
7991 7987
@@ -8170,13 +8166,9 @@ static struct cftype files[] = {
8170 .name = "stat", 8166 .name = "stat",
8171 .read_map = cpuacct_stats_show, 8167 .read_map = cpuacct_stats_show,
8172 }, 8168 },
8169 { } /* terminate */
8173}; 8170};
8174 8171
8175static int cpuacct_populate(struct cgroup_subsys *ss, struct cgroup *cgrp)
8176{
8177 return cgroup_add_files(cgrp, ss, files, ARRAY_SIZE(files));
8178}
8179
8180/* 8172/*
8181 * charge this task's execution time to its accounting group. 8173 * charge this task's execution time to its accounting group.
8182 * 8174 *
@@ -8208,7 +8200,7 @@ struct cgroup_subsys cpuacct_subsys = {
8208 .name = "cpuacct", 8200 .name = "cpuacct",
8209 .create = cpuacct_create, 8201 .create = cpuacct_create,
8210 .destroy = cpuacct_destroy, 8202 .destroy = cpuacct_destroy,
8211 .populate = cpuacct_populate,
8212 .subsys_id = cpuacct_subsys_id, 8203 .subsys_id = cpuacct_subsys_id,
8204 .base_cftypes = files,
8213}; 8205};
8214#endif /* CONFIG_CGROUP_CPUACCT */ 8206#endif /* CONFIG_CGROUP_CPUACCT */