[PATCH OLK-6.6] arm64/mpam: Fix num_rmids when enable CDP mode

hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/ICVT5V -------------------------------- At initialization, the number of RMIDs is set to num_of_PARTID * num_of_PMG. When resctrl is later mounted in CDP mode, however, the RMID count should be halved, just like the CLOSID count. Because CDP mode is activated during the mount operation, update the num_of_RMID in rdt_enable_ctx(). Fixes: ae6bcabac715 ("arm64/mpam: Fix num_rmids information") Signed-off-by: Zeng Heng <zengheng4@huawei.com> --- drivers/platform/mpam/mpam_resctrl.c | 8 +++++++- include/linux/arm_mpam.h | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/platform/mpam/mpam_resctrl.c b/drivers/platform/mpam/mpam_resctrl.c index c4049cbfe8eb..bb350d672836 100644 --- a/drivers/platform/mpam/mpam_resctrl.c +++ b/drivers/platform/mpam/mpam_resctrl.c @@ -101,11 +101,17 @@ bool resctrl_arch_get_cdp_enabled(enum resctrl_res_level rid) } } -int resctrl_arch_set_cdp_enabled(enum resctrl_res_level ignored, bool enable) +int resctrl_arch_set_cdp_enabled(enum resctrl_res_level rid, bool enable) { u64 regval; + struct rdt_resource *r; u32 partid, partid_i, partid_d; + r = resctrl_arch_get_resource(rid); + r->num_rmid = resctrl_arch_system_num_rmid_idx(); + if (enable) + r->num_rmid >>= 1; + cdp_enabled = enable; partid = RESCTRL_RESERVED_CLOSID; diff --git a/include/linux/arm_mpam.h b/include/linux/arm_mpam.h index 3a06a8afad7c..0c14f62a0e8f 100644 --- a/include/linux/arm_mpam.h +++ b/include/linux/arm_mpam.h @@ -74,7 +74,7 @@ bool resctrl_arch_would_mbm_overflow(void); void resctrl_arch_reset_resources(void); bool resctrl_arch_get_cdp_enabled(enum resctrl_res_level ignored); -int resctrl_arch_set_cdp_enabled(enum resctrl_res_level ignored, bool enable); +int resctrl_arch_set_cdp_enabled(enum resctrl_res_level rid, bool enable); bool resctrl_arch_hide_cdp(enum resctrl_res_level rid); bool resctrl_arch_match_closid(struct task_struct *tsk, u32 closid); bool resctrl_arch_match_rmid(struct task_struct *tsk, u32 closid, u32 rmid); -- 2.25.1

反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/17840 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/3VO... 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/17840 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/3VO...
participants (2)
-
patchwork bot
-
Zeng Heng