提交 e0aed913 编写于 作者: W Wang ShaoBo 提交者: Yang Yingliang

arm64/mpam: resctrl: Add rmid file in resctrl sysfs

hulk inclusion
category: feature
bugzilla: 34278
CVE: NA

-------------------------------------------------

rmid is used to mark each resctrl group for monitoring, anyhow, also
following corresponding resctrl group's configuration, we export rmid
sysfile to resctrl sysfs for any usage elsewhere such as SMMU io, user
can get rmid from a resctrl group and set this rmid to a target io
through SMMU driver if SMMU MPAM implemented, so make related io devices
can be monitored or accomplish aimed configuration for resource's usage.
Signed-off-by: NWang ShaoBo <bobo.shaobowang@huawei.com>
Reviewed-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
Reviewed-by: NCheng Jian <cj.chengjian@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NCheng Jian <cj.chengjian@huawei.com>
上级 6892e52d
...@@ -1733,6 +1733,29 @@ static int resctrl_group_tasks_show(struct kernfs_open_file *of, ...@@ -1733,6 +1733,29 @@ static int resctrl_group_tasks_show(struct kernfs_open_file *of,
return ret; return ret;
} }
static int resctrl_group_rmid_show(struct kernfs_open_file *of,
struct seq_file *s, void *v)
{
int ret = 0;
struct rdtgroup *rdtgrp;
u32 flag, times;
hw_alloc_times_validate(times, flag);
rdtgrp = resctrl_group_kn_lock_live(of->kn);
if (rdtgrp) {
if (flag)
seq_printf(s, "%u-%u\n", rdtgrp->mon.rmid,
rdtgrp->mon.rmid + 1);
else
seq_printf(s, "%u\n", rdtgrp->mon.rmid);
} else
ret = -ENOENT;
resctrl_group_kn_unlock(of->kn);
return ret;
}
/* rdtgroup information files for one cache resource. */ /* rdtgroup information files for one cache resource. */
static struct rftype res_specific_files[] = { static struct rftype res_specific_files[] = {
{ {
...@@ -1830,6 +1853,13 @@ static struct rftype res_specific_files[] = { ...@@ -1830,6 +1853,13 @@ static struct rftype res_specific_files[] = {
.seq_show = resctrl_group_tasks_show, .seq_show = resctrl_group_tasks_show,
.fflags = RFTYPE_BASE, .fflags = RFTYPE_BASE,
}, },
{
.name = "rmid",
.mode = 0444,
.kf_ops = &resctrl_group_kf_single_ops,
.seq_show = resctrl_group_rmid_show,
.fflags = RFTYPE_BASE,
},
{ {
.name = "schemata", .name = "schemata",
.mode = 0644, .mode = 0644,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册