Commit f098705e authored by Wang ShaoBo's avatar Wang ShaoBo Committed by Zheng Zengkai
Browse files

arm64/mpam: resctrl: collect child mon group's monitor data



hulk inclusion
category: feature
feature: ARM MPAM support
bugzilla: 48265
CVE: NA

--------------------------------

For each ctrl group, it's monitoring data should include all it's child
mon groups' monitoring data, these code is borrowed from Intel-RDT for
facilitating users to configure different monitoring strategies.

Signed-off-by: default avatarWang ShaoBo <bobo.shaobowang@huawei.com>
Reviewed-by: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
Reviewed-by: default avatarCheng Jian <cj.chengjian@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 26a57873
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -449,6 +449,33 @@ int resctrl_group_mondata_show(struct seq_file *m, void *arg)
	}

	usage = rr->mon_read(d, md.priv);
	/*
	 * if this rdtgroup is ctrlmon group, also collect it's
	 * mon groups' monitor data.
	 */
	if (rdtgrp->type == RDTCTRL_GROUP) {
		struct list_head *head;
		struct rdtgroup *entry;
		hw_closid_t hw_closid;
		enum resctrl_conf_type type = CDP_CODE;

		resctrl_cdp_map(clos, rdtgrp->closid.reqpartid,
			CDP_CODE, hw_closid);
		/* CDP_CODE share the same closid with CDP_BOTH */
		if (md.u.partid != hw_closid_val(hw_closid))
			type = CDP_DATA;

		head = &rdtgrp->mon.crdtgrp_list;
		list_for_each_entry(entry, head, mon.crdtgrp_list) {
			resctrl_cdp_map(clos, entry->closid.reqpartid,
				type, hw_closid);
			md.u.partid = hw_closid_val(hw_closid);
			md.u.pmg = entry->mon.rmid;
			md.u.mon = entry->mon.mon;
			usage += rr->mon_read(d, md.priv);
		}
	}

	seq_printf(m, "%llu\n", usage);

out: