diff mbox series

[RFC,3/3] psi: add cgroup v1 interfaces

Message ID 20190604015745.78972-4-joseph.qi@linux.alibaba.com (mailing list archive)
State New, archived
Headers show
Series psi: support cgroup v1 | expand

Commit Message

Joseph Qi June 4, 2019, 1:57 a.m. UTC
For cgroup v1, interfaces are under each subsystem.
/sys/fs/cgroup/cpuacct/cpu.pressure
/sys/fs/cgroup/memory/memory.pressure
/sys/fs/cgroup/blkio/io.pressure

Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
---
 block/blk-throttle.c   | 10 ++++++++++
 kernel/sched/cpuacct.c | 10 ++++++++++
 mm/memcontrol.c        | 10 ++++++++++
 3 files changed, 30 insertions(+)
diff mbox series

Patch

diff --git a/block/blk-throttle.c b/block/blk-throttle.c
index 9ea7c0ecad10..b802262ecf8a 100644
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -1510,6 +1510,16 @@  static struct cftype throtl_legacy_files[] = {
 		.private = (unsigned long)&blkcg_policy_throtl,
 		.seq_show = blkg_print_stat_ios_recursive,
 	},
+#ifdef CONFIG_PSI
+	{
+		.name = "io.pressure",
+		.flags = CFTYPE_NO_PREFIX,
+		.seq_show = cgroup_io_pressure_show,
+		.write = cgroup_io_pressure_write,
+		.poll = cgroup_pressure_poll,
+		.release = cgroup_pressure_release,
+	},
+#endif /* CONFIG_PSI */
 	{ }	/* terminate */
 };
 
diff --git a/kernel/sched/cpuacct.c b/kernel/sched/cpuacct.c
index 9fbb10383434..58ccfaf996aa 100644
--- a/kernel/sched/cpuacct.c
+++ b/kernel/sched/cpuacct.c
@@ -327,6 +327,16 @@  static struct cftype files[] = {
 		.name = "stat",
 		.seq_show = cpuacct_stats_show,
 	},
+#ifdef CONFIG_PSI
+	{
+		.name = "cpu.pressure",
+		.flags = CFTYPE_NO_PREFIX,
+		.seq_show = cgroup_cpu_pressure_show,
+		.write = cgroup_cpu_pressure_write,
+		.poll = cgroup_pressure_poll,
+		.release = cgroup_pressure_release,
+	},
+#endif /* CONFIG_PSI */
 	{ }	/* terminate */
 };
 
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index ca0bc6e6be13..4fc752719412 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4391,6 +4391,16 @@  static struct cftype mem_cgroup_legacy_files[] = {
 		.write = mem_cgroup_reset,
 		.read_u64 = mem_cgroup_read_u64,
 	},
+#ifdef CONFIG_PSI
+	{
+		.name = "memory.pressure",
+		.flags = CFTYPE_NO_PREFIX,
+		.seq_show = cgroup_memory_pressure_show,
+		.write = cgroup_memory_pressure_write,
+		.poll = cgroup_pressure_poll,
+		.release = cgroup_pressure_release,
+	},
+#endif /* CONFIG_PSI */
 	{ },	/* terminate */
 };