[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a4ca7d43100132b79adba85a4674c7b46b05bb8c.1769029977.git.babu.moger@amd.com>
Date: Wed, 21 Jan 2026 15:12:41 -0600
From: Babu Moger <babu.moger@....com>
To: <corbet@....net>, <tony.luck@...el.com>, <reinette.chatre@...el.com>,
<Dave.Martin@....com>, <james.morse@....com>, <babu.moger@....com>,
<tglx@...nel.org>, <mingo@...hat.com>, <bp@...en8.de>,
<dave.hansen@...ux.intel.com>
CC: <x86@...nel.org>, <hpa@...or.com>, <peterz@...radead.org>,
<juri.lelli@...hat.com>, <vincent.guittot@...aro.org>,
<dietmar.eggemann@....com>, <rostedt@...dmis.org>, <bsegall@...gle.com>,
<mgorman@...e.de>, <vschneid@...hat.com>, <akpm@...ux-foundation.org>,
<pawan.kumar.gupta@...ux.intel.com>, <pmladek@...e.com>,
<feng.tang@...ux.alibaba.com>, <kees@...nel.org>, <arnd@...db.de>,
<fvdl@...gle.com>, <lirongqing@...du.com>, <bhelgaas@...gle.com>,
<seanjc@...gle.com>, <xin@...or.com>, <manali.shukla@....com>,
<dapeng1.mi@...ux.intel.com>, <chang.seok.bae@...el.com>,
<mario.limonciello@....com>, <naveen@...nel.org>,
<elena.reshetova@...el.com>, <thomas.lendacky@....com>,
<linux-doc@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<kvm@...r.kernel.org>, <peternewman@...gle.com>, <eranian@...gle.com>,
<gautham.shenoy@....com>
Subject: [RFC PATCH 03/19] fs/resctrl: Add new interface max_bandwidth
While min_bandwidth is exposed for each resource under
/sys/fs/resctrl, the maximum supported bandwidth is not currently shown.
Add max_bandwidth to report the maximum bandwidth permitted for a resource.
This helps users understand the limits of the associated resource control
group.
Signed-off-by: Babu Moger <babu.moger@....com>
---
Documentation/filesystems/resctrl.rst | 6 +++++-
fs/resctrl/rdtgroup.c | 17 +++++++++++++++++
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/Documentation/filesystems/resctrl.rst b/Documentation/filesystems/resctrl.rst
index 45dde8774128..94187dd3c244 100644
--- a/Documentation/filesystems/resctrl.rst
+++ b/Documentation/filesystems/resctrl.rst
@@ -224,7 +224,11 @@ Memory bandwidth(MB) subdirectory contains the following files
with respect to allocation:
"min_bandwidth":
- The minimum memory bandwidth percentage which
+ The minimum memory bandwidth percentage or units which
+ user can request.
+
+"max_bandwidth":
+ The maximum memory bandwidth percentage or units which
user can request.
"bandwidth_gran":
diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
index ae6c515f4c19..d2eab9007cc1 100644
--- a/fs/resctrl/rdtgroup.c
+++ b/fs/resctrl/rdtgroup.c
@@ -1153,6 +1153,16 @@ static int rdt_min_bw_show(struct kernfs_open_file *of,
return 0;
}
+static int rdt_max_bw_show(struct kernfs_open_file *of,
+ struct seq_file *seq, void *v)
+{
+ struct resctrl_schema *s = rdt_kn_parent_priv(of->kn);
+ struct rdt_resource *r = s->res;
+
+ seq_printf(seq, "%u\n", r->membw.max_bw);
+ return 0;
+}
+
static int rdt_num_rmids_show(struct kernfs_open_file *of,
struct seq_file *seq, void *v)
{
@@ -1959,6 +1969,13 @@ static struct rftype res_common_files[] = {
.seq_show = rdt_min_bw_show,
.fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_MB,
},
+ {
+ .name = "max_bandwidth",
+ .mode = 0444,
+ .kf_ops = &rdtgroup_kf_single_ops,
+ .seq_show = rdt_max_bw_show,
+ .fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_MB,
+ },
{
.name = "bandwidth_gran",
.mode = 0444,
--
2.34.1
Powered by blists - more mailing lists