linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Joseph Qi <joseph.qi@linux.alibaba.com>
To: linux-mm@kvack.org, cgroups@vger.kernel.org
Cc: Johannes Weiner <hannes@cmpxchg.org>,
	akpm@linux-foundation.org, Tejun Heo <tj@kernel.org>,
	Jiufei Xue <jiufei.xue@linux.alibaba.com>,
	Caspar Zhang <caspar@linux.alibaba.com>,
	Joseph Qi <joseph.qi@linux.alibaba.com>
Subject: [RFC PATCH 3/3] psi: add cgroup v1 interfaces
Date: Tue,  4 Jun 2019 09:57:45 +0800	[thread overview]
Message-ID: <20190604015745.78972-4-joseph.qi@linux.alibaba.com> (raw)
In-Reply-To: <20190604015745.78972-1-joseph.qi@linux.alibaba.com>

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 --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 */
 };
 
-- 
2.19.1.856.g8858448bb


      parent reply	other threads:[~2019-06-04  1:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-04  1:57 [RFC PATCH 0/3] psi: support cgroup v1 Joseph Qi
2019-06-04  1:57 ` [RFC PATCH 1/3] psi: make cgroup psi helpers public Joseph Qi
2019-06-04  1:57 ` [RFC PATCH 2/3] psi: cgroup v1 support Joseph Qi
2019-06-04 11:55   ` Johannes Weiner
2019-06-05  1:15     ` Joseph Qi
2019-06-04  1:57 ` Joseph Qi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190604015745.78972-4-joseph.qi@linux.alibaba.com \
    --to=joseph.qi@linux.alibaba.com \
    --cc=akpm@linux-foundation.org \
    --cc=caspar@linux.alibaba.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=jiufei.xue@linux.alibaba.com \
    --cc=linux-mm@kvack.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox