hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9SXQ8
--------------------------------
resctrl_dom_mon_data() call do_device_sync() wait for other CPU to respond IPI, which is expensive (up to a few ms). resctrl_dom_mon_data() may be called hundreds of times by resctrl_group_mondata_show(), causing soft lockup.
Fix this by adding a cond_resched between each loop.
Do the same for resctrl_group_update_domain_ctrls().
Fixes: 8d7469cd8d3e ("arm64/mpam: Integrate monitor data for Memory Bandwidth if cdp enabled") Signed-off-by: Yu Liao liaoyu15@huawei.com --- arch/arm64/kernel/mpam/mpam_ctrlmon.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/arch/arm64/kernel/mpam/mpam_ctrlmon.c b/arch/arm64/kernel/mpam/mpam_ctrlmon.c index 12e188f0b788..3780c0ec0819 100644 --- a/arch/arm64/kernel/mpam/mpam_ctrlmon.c +++ b/arch/arm64/kernel/mpam/mpam_ctrlmon.c @@ -289,6 +289,7 @@ static void resctrl_group_update_domain_ctrls(struct rdtgroup *rdtgrp, resctrl_cdp_mpamid_map_val(entry->closid.reqpartid, cfg[i].conf_type, closid.reqpartid); resctrl_dom_ctrl_config(cdp_both_ctrl, r, dom, ¶); + cond_resched(); } } } @@ -662,6 +663,8 @@ int resctrl_group_mondata_show(struct seq_file *m, void *arg) r->rid), type, md.u.mon);
usage += resctrl_dom_mon_data(r, d, md.priv); + + cond_resched(); } }