Commit bcb362eb authored by Yu Liao's avatar Yu Liao
Browse files

arm64/mpam: Fix softlockup when reading mondata

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: 8d7469cd ("arm64/mpam: Integrate monitor data for Memory Bandwidth if cdp enabled")
Signed-off-by: default avatarYu Liao <liaoyu15@huawei.com>
parent 3b7f6009
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -285,6 +285,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, &para);
			cond_resched();
		}
	}
}
@@ -658,6 +659,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();
		}
	}