Unverified Commit 9022a417 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!5672 arm64/mpam_ctrlmon: Update ctrl group config with rdtgrp's partid

Merge Pull Request from: @ci-robot 
 
PR sync from: Zeng Heng <zengheng4@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/M3NGAYGNOYOA5WTYFEHWULMLK5HIEZQT/ 
Zeng Heng (2):
  arm64/mpam_ctrlmon: Update ctrl group config with rdtgrp's partid
  arm64/mpam: Allocate new partid for the created ctrl group


--
2.25.1
 
https://gitee.com/openeuler/kernel/issues/I9ARW6 
 
Link:https://gitee.com/openeuler/kernel/pulls/5672

 

Reviewed-by: default avatarWang ShaoBo <bobo.shaobowang@huawei.com>
Reviewed-by: default avatarWei Li <liwei391@huawei.com>
Reviewed-by: default avatarzhangyi (F) <yi.zhang@huawei.com>
Reviewed-by: default avatarLiu YongQiang <liuyongqiang13@huawei.com>
Signed-off-by: default avatarZhang Changzhong <zhangchangzhong@huawei.com>
parents ec7a5c4d 81f45e29
Loading
Loading
Loading
Loading
+7 −14
Original line number Diff line number Diff line
@@ -216,11 +216,9 @@ static void resctrl_group_resync_domain_ctrls(struct rdtgroup *rdtgrp,

	for (i = staged_start; i <= staged_end; i++) {
		cdp_both_ctrl = cfg[i].cdp_both_ctrl;
		/*
		 * for ctrl group configuration, hw_closid of cfg[i] equals
		 * to rdtgrp->closid.intpartid.
		 */
		closid.intpartid = hw_closid_val(cfg[i].hw_closid);

		resctrl_cdp_mpamid_map_val(rdtgrp->closid.intpartid,
					   cfg[i].conf_type, closid.intpartid);
		resctrl_cdp_mpamid_map_val(rdtgrp->closid.reqpartid,
				cfg[i].conf_type, closid.reqpartid);
		resctrl_dom_ctrl_config(cdp_both_ctrl, r, dom, &para);
@@ -229,8 +227,6 @@ static void resctrl_group_resync_domain_ctrls(struct rdtgroup *rdtgrp,
		 * we should synchronize all child mon groups'
		 * configuration from this ctrl rdtgrp
		 */
		resctrl_cdp_mpamid_map_val(rdtgrp->closid.intpartid,
					   cfg[i].conf_type, closid.intpartid);
		head = &rdtgrp->mon.crdtgrp_list;
		list_for_each_entry(entry, head, mon.crdtgrp_list) {
			resctrl_cdp_mpamid_map_val(entry->closid.reqpartid,
@@ -260,11 +256,9 @@ static void resctrl_group_update_domain_ctrls(struct rdtgroup *rdtgrp,
			continue;
		update_on = false;
		cdp_both_ctrl = cfg[i].cdp_both_ctrl;
		/*
		 * for ctrl group configuration, hw_closid of cfg[i] equals
		 * to rdtgrp->closid.intpartid.
		 */
		closid.intpartid = hw_closid_val(cfg[i].hw_closid);

		resctrl_cdp_mpamid_map_val(rdtgrp->closid.intpartid,
					   cfg[i].conf_type, closid.intpartid);
		for_each_ctrl_type(type) {
			/* if ctrl group's config has changed, refresh it first. */
			if (dom->ctrl_val[type][closid.intpartid] != cfg[i].new_ctrl[type] &&
@@ -279,6 +273,7 @@ static void resctrl_group_update_domain_ctrls(struct rdtgroup *rdtgrp,
				dom->ctrl_val[type][closid.intpartid] =
					cfg[i].new_ctrl[type];
				dom->have_new_ctrl = true;
				cfg[i].ctrl_updated[type] = false;
				update_on = true;
			}
		}
@@ -289,8 +284,6 @@ static void resctrl_group_update_domain_ctrls(struct rdtgroup *rdtgrp,
		 * we should synchronize all child mon groups'
		 * configuration from this ctrl rdtgrp
		 */
		resctrl_cdp_mpamid_map_val(rdtgrp->closid.intpartid,
					   cfg[i].conf_type, closid.intpartid);
		head = &rdtgrp->mon.crdtgrp_list;
		list_for_each_entry(entry, head, mon.crdtgrp_list) {
			resctrl_cdp_mpamid_map_val(entry->closid.reqpartid,
+22 −15
Original line number Diff line number Diff line
@@ -549,10 +549,15 @@ static int find_rdtgrp_allocable_rmid(struct resctrl_group *rdtgrp)

	prgrp = rdtgrp->mon.parent;

	do {
	/*
	 * Create ctrl group under root group, just allocate new partid
	 */
	if (rdtgrp->type == RDTCTRL_GROUP)
		goto rmid_realloc;

	rmid = rmid_alloc(prgrp->closid.reqpartid);
	if (rmid >= 0)
			break;
		goto rmid_attach;

	head = &prgrp->mon.crdtgrp_list;
	list_for_each_entry(entry, head, mon.crdtgrp_list) {
@@ -561,19 +566,21 @@ static int find_rdtgrp_allocable_rmid(struct resctrl_group *rdtgrp)

		rmid = rmid_alloc(entry->closid.reqpartid);
		if (rmid >= 0)
				break;
			goto rmid_attach;
	}
	} while (0);

	if (rmid < 0)
rmid_realloc:
	rmid = rmid_alloc(-1);
	if (rmid < 0)
		return rmid;

rmid_attach:
	ret = mpam_rmid_to_partid_pmg(rmid, &reqpartid, NULL);
	if (ret)
		return ret;

	rdtgrp->mon.rmid = rmid;
	rdtgrp->closid.reqpartid = reqpartid;

	return rmid;
}