[PATCH OLK-6.6] fs/resctrl: L2_MON does not support the limbo mechanism

hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IC30P1 -------------------------------- Currently, only L3_MON supports the limbo mechanism, while L2_MON does not. Therefore, during initialization, avoid incorrect initialization of the resctrl_rmid_realloc_limit and resctrl_rmid_realloc_threshold variables by L2_MON. Similarly, since L2_MON does not support read/write operations on the max_threshold_occupancy interface, and directly returns. Fixes: 556688623b2b ("fs/resctrl: Create l2 cache monitors") Signed-off-by: Zeng Heng <zengheng4@huawei.com> --- drivers/platform/mpam/mpam_resctrl.c | 6 ++++-- fs/resctrl/rdtgroup.c | 9 +++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/platform/mpam/mpam_resctrl.c b/drivers/platform/mpam/mpam_resctrl.c index ae02d33dab3f..8de4aae95253 100644 --- a/drivers/platform/mpam/mpam_resctrl.c +++ b/drivers/platform/mpam/mpam_resctrl.c @@ -738,8 +738,10 @@ static void mpam_resctrl_pick_caches(void) continue; } - if (mpam_has_feature(mpam_feat_msmon_csu, cprops)) - update_rmid_limits(cache_size); + if (mpam_has_feature(mpam_feat_msmon_csu, cprops)) { + if (class->level == 3) + update_rmid_limits(cache_size); + } if (has_cpor) { if (class->level == 2) { diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index 39c83694956d..86567d32e4df 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -1304,6 +1304,11 @@ static int rdt_delay_linear_show(struct kernfs_open_file *of, static int max_threshold_occ_show(struct kernfs_open_file *of, struct seq_file *seq, void *v) { + struct rdt_resource *r = of->kn->parent->priv; + + if (r->cache_level != 3) + return 0; + seq_printf(seq, "%u\n", resctrl_rmid_realloc_threshold); return 0; @@ -1326,9 +1331,13 @@ static int rdt_thread_throttle_mode_show(struct kernfs_open_file *of, static ssize_t max_threshold_occ_write(struct kernfs_open_file *of, char *buf, size_t nbytes, loff_t off) { + struct rdt_resource *r = of->kn->parent->priv; unsigned int bytes; int ret; + if (r->cache_level != 3) + return 0; + ret = kstrtouint(buf, 0, &bytes); if (ret) return ret; -- 2.25.1

反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/16679 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/BB4... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/16679 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/BB4...
participants (2)
-
patchwork bot
-
Zeng Heng