[PATCH OLK-6.6 0/3] arm64/mpam: Reset mbwu_state while creating new monitor group
Zeng Heng (3): arm64/mpam: Reset mbwu_state while creating new monitor group arm64/mpam: Remove the redundant prev_val member variable arm64/mpam: Need to reset MPAM component when umounting resctrl drivers/platform/mpam/mpam_devices.c | 9 +-------- drivers/platform/mpam/mpam_internal.h | 3 --- drivers/platform/mpam/mpam_resctrl.c | 3 ++- 3 files changed, 3 insertions(+), 12 deletions(-) -- 2.25.1
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IDA88U -------------------------------- For the MBWU bandwidth monitor, after a monitor group is deleted, the mbwu_state needs to clear before creating another new monitor group. Otherwise, that would affect the initial values of the newly created monitor group. Therefore, in resctrl_arch_reset_rmid(), all events except for the occupancy event-ids need to call mpam_msmon_reset_mbwu(). Fixes: 006d3b5b7aeb ("arm_mpam: resctrl: Add resctrl_arch_rmid_read() and resctrl_arch_reset_rmid()") Signed-off-by: Zeng Heng <zengheng4@huawei.com> --- drivers/platform/mpam/mpam_resctrl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/platform/mpam/mpam_resctrl.c b/drivers/platform/mpam/mpam_resctrl.c index 7c386ce7b80f..8ee0857f9a93 100644 --- a/drivers/platform/mpam/mpam_resctrl.c +++ b/drivers/platform/mpam/mpam_resctrl.c @@ -439,7 +439,8 @@ void resctrl_arch_reset_rmid(struct rdt_resource *r, struct rdt_domain *d, struct mpam_resctrl_dom *dom; struct mpam_resctrl_res *res; - if (eventid != QOS_L3_MBM_LOCAL_EVENT_ID) + if (eventid == QOS_L3_OCCUP_EVENT_ID || + eventid == QOS_L2_OCCUP_EVENT_ID) return; res = container_of(r, struct mpam_resctrl_res, resctrl_res); -- 2.25.1
hulk inclusion category: cleanup bugzilla: https://gitee.com/openeuler/kernel/issues/ID29QH -------------------------------- After merging the commit 59874d0ded9c, the prev_val variable is no longer referenced, so it can be removed. Fixes: 59874d0ded9c ("arm64/mpam: Fix MBWU monitor overflow handling") Signed-off-by: Zeng Heng <zengheng4@huawei.com> --- drivers/platform/mpam/mpam_devices.c | 8 -------- drivers/platform/mpam/mpam_internal.h | 3 --- 2 files changed, 11 deletions(-) diff --git a/drivers/platform/mpam/mpam_devices.c b/drivers/platform/mpam/mpam_devices.c index 387fc444267c..fab2dba70c9f 100644 --- a/drivers/platform/mpam/mpam_devices.c +++ b/drivers/platform/mpam/mpam_devices.c @@ -937,7 +937,6 @@ static void write_msmon_ctl_flt_vals(struct mon_read *m, u32 ctl_val, u32 flt_val) { struct mpam_msc *msc = m->ris->msc; - struct msmon_mbwu_state *mbwu_state; /* * Write the ctl_val with the enable bit cleared, reset the counter, @@ -960,11 +959,6 @@ static void write_msmon_ctl_flt_vals(struct mon_read *m, u32 ctl_val, mpam_write_monsel_reg(msc, MBWU, 0); mpam_write_monsel_reg(msc, CFG_MBWU_CTL, ctl_val|MSMON_CFG_x_CTL_EN); - - mbwu_state = &m->ris->mbwu_state[m->ctx->mon]; - if (mbwu_state) - mbwu_state->prev_val = 0; - break; default: return; @@ -1070,7 +1064,6 @@ static void __ris_msmon_read(void *arg) mpam_csu_hisi_need_retrigger(ris, m->err == -EBUSY)) { write_msmon_ctl_flt_vals(m, ctl_val, flt_val); if (mbwu_state) { - mbwu_state->prev_val = 0; mbwu_state->correction = 0; mbwu_overflow = false; } @@ -1132,7 +1125,6 @@ static void __ris_msmon_read(void *arg) if (mbwu_overflow) overflow_val = mpam_msmon_overflow_val(ris); - mbwu_state->prev_val = now; mbwu_state->correction += overflow_val; /* Include bandwidth consumed before the last hardware reset */ diff --git a/drivers/platform/mpam/mpam_internal.h b/drivers/platform/mpam/mpam_internal.h index 7fe4ac636952..5f60e0cc4eeb 100644 --- a/drivers/platform/mpam/mpam_internal.h +++ b/drivers/platform/mpam/mpam_internal.h @@ -224,9 +224,6 @@ struct msmon_mbwu_state { bool reset_on_next_read; struct mon_cfg cfg; - /* The value last read from the hardware. Used to detect overflow. */ - u64 prev_val; - /* * The value to add to the new reading to account for power management, * and shifts to trigger the overflow interrupt. -- 2.25.1
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IDAXZ8 -------------------------------- Restore all MPAM configurations to avoid impacting system performance after unmounting resctrl. After user updates the MPAM configuration, in_reset_state must be set to false. Only then, mpam_reset_ris() will restore the MPAM register setting. Fixes: be74872ad2e3 ("arm_mpam: Allow configuration to be applied and restored during cpu online") Signed-off-by: Zeng Heng <zengheng4@huawei.com> --- drivers/platform/mpam/mpam_devices.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/platform/mpam/mpam_devices.c b/drivers/platform/mpam/mpam_devices.c index fab2dba70c9f..6c1c82f79ec0 100644 --- a/drivers/platform/mpam/mpam_devices.c +++ b/drivers/platform/mpam/mpam_devices.c @@ -2576,6 +2576,7 @@ int mpam_apply_config(struct mpam_component *comp, u16 partid, arg.ris = ris; mutex_lock(&ris->msc->lock); mpam_touch_msc(ris->msc, __write_config, &arg); + ris->in_reset_state = false; mutex_unlock(&ris->msc->lock); } srcu_read_unlock(&mpam_srcu, idx); -- 2.25.1
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/19511 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/RW5... 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/19511 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/RW5...
participants (2)
-
patchwork bot -
Zeng Heng