[PATCH OLK-5.10] arm64/mpam: Add nrdy latency to mbw_rdmon.
hulk inclusion category: bugfix bugzilla: https://atomgit.com/openeuler/kernel/issues/8421 Reference: https://atomgit.com/openeuler/kernel/pull/15200 -------------------------------- On some platforms, when configuring a new partid, the NRDY bit remains 0, we need to re-read the statistics result to ensure accurate data. However, due to the statistical mechanism, this re-reading needs to have a certain nrdy delay; otherwise, statistical errors may occur. Fix it by adding nrdy latency to mbw_rdmon. Fixes: da1960a8d3b4 ("arm64/mpam: Add quirk for MPAM MSMON_MBWU monitor NRDY bit") Signed-off-by: Quanmin Yan <yanquanmin1@huawei.com> --- arch/arm64/kernel/mpam/mpam_resctrl.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/mpam/mpam_resctrl.c b/arch/arm64/kernel/mpam/mpam_resctrl.c index 4cc18c90a601..51b4edb1b1bb 100644 --- a/arch/arm64/kernel/mpam/mpam_resctrl.c +++ b/arch/arm64/kernel/mpam/mpam_resctrl.c @@ -490,7 +490,7 @@ static u64 cache_rdmon(struct rdt_domain *d, void *md_priv) static u64 mbw_rdmon(struct rdt_domain *d, void *md_priv) { int err; - u64 result; + u64 result, wait_jiffies; union mon_data_bits md; struct sync_args args; struct mpam_resctrl_dom *dom; @@ -520,7 +520,19 @@ static u64 mbw_rdmon(struct rdt_domain *d, void *md_priv) err = mpam_component_mon(dom->comp, &args, &result); /* Currently just report it */ WARN_ON(err && (err != -EBUSY)); - } while (err == -EBUSY); + + if (err != -EBUSY) + break; + + /* + * The "nrdy_usec" needs to be waited. Since there is + * currently no way to obtain "arm,not-ready-us", + * only a hardcoded value is written. + */ + wait_jiffies = usecs_to_jiffies(1000); + while (wait_jiffies) + wait_jiffies = schedule_timeout_uninterruptible(wait_jiffies); + } while (1); return result; } -- 2.43.0
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://atomgit.com/openeuler/kernel/merge_requests/21336 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/USI... 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://atomgit.com/openeuler/kernel/merge_requests/21336 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/USI...
participants (2)
-
patchwork bot -
Quanmin Yan