From: Wang ShaoBo bobo.shaobowang@huawei.com
hulk inclusion category: bugfix bugzilla: 34588 CVE: NA
-----------------------------------------------
In many cases writing resctrl interface may return failure, but err tips in info/last_cmd_status remain ok. e.g. > echo 'L3:5=7fff' > schemata -bash: echo: write error: Invalid argument > cat info/last_cmd_status ok > cat ctrlmon 1 > echo 1 > ctrlmon -bash: echo: write error: No such file or directory > cat info/last_cmd_status ok We add extra tips when goes to this branches.
Signed-off-by: Wang ShaoBo bobo.shaobowang@huawei.com Reviewed-by: Xie XiuQi xiexiuqi@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- arch/arm64/kernel/mpam.c | 7 ++++++- arch/arm64/kernel/mpam_ctrlmon.c | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/mpam.c b/arch/arm64/kernel/mpam.c index 120795e..3f89cec 100644 --- a/arch/arm64/kernel/mpam.c +++ b/arch/arm64/kernel/mpam.c @@ -858,7 +858,7 @@ static int resctrl_num_mon_show(struct kernfs_open_file *of, int cpus_mon_write(struct rdtgroup *rdtgrp, cpumask_var_t newmask, cpumask_var_t tmpmask) { - pr_info("unsupported on mon_groups, please use ctrlmon groups\n"); + rdt_last_cmd_puts("temporarily unsupported write cpus on mon_groups\n"); return -EINVAL; }
@@ -1143,6 +1143,7 @@ static ssize_t resctrl_group_ctrlmon_write(struct kernfs_open_file *of,
if (!rdtgrp) { ret = -ENOENT; + rdt_last_cmd_puts("directory was removed\n"); goto unlock; }
@@ -1156,6 +1157,10 @@ static ssize_t resctrl_group_ctrlmon_write(struct kernfs_open_file *of, if (!ret) rdtgrp->flags |= RDT_CTRLMON; } else { + if (ctrlmon) + rdt_last_cmd_printf("ctrlmon has been enabled\n"); + else + rdt_last_cmd_printf("ctrlmon has been disabled\n"); ret = -ENOENT; }
diff --git a/arch/arm64/kernel/mpam_ctrlmon.c b/arch/arm64/kernel/mpam_ctrlmon.c index 2b94efc..850c52f 100644 --- a/arch/arm64/kernel/mpam_ctrlmon.c +++ b/arch/arm64/kernel/mpam_ctrlmon.c @@ -171,6 +171,9 @@ static int parse_line(char *line, struct resctrl_resource *r) goto next; } } + + rdt_last_cmd_printf("unknown domain (%lu)\n", dom_id); + return -EINVAL; }
@@ -224,6 +227,7 @@ ssize_t resctrl_group_schemata_write(struct kernfs_open_file *of, rdtgrp = resctrl_group_kn_lock_live(of->kn); if (!rdtgrp) { resctrl_group_kn_unlock(of->kn); + rdt_last_cmd_puts("directory was removed\n"); return -ENOENT; } rdt_last_cmd_clear();