Zeng Heng (2): arm64/mpam_ctrlmon: Update ctrl group config with rdtgrp's partid arm64/mpam: Allocate new partid for the created ctrl group
arch/arm64/kernel/mpam/mpam_ctrlmon.c | 21 +++++---------- fs/resctrlfs.c | 37 ++++++++++++++++----------- 2 files changed, 29 insertions(+), 29 deletions(-)
-- 2.25.1
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9ARW6
-----------------------------
Not only monitor groups should follow rdtgrp's partid, but also the control group should adopt the rdtgrp's partid.
Fixes: 08127bbfcfae ("mpam: update monitor rmid and group configuration") Signed-off-by: Zeng Heng zengheng4@huawei.com --- arch/arm64/kernel/mpam/mpam_ctrlmon.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-)
diff --git a/arch/arm64/kernel/mpam/mpam_ctrlmon.c b/arch/arm64/kernel/mpam/mpam_ctrlmon.c index 0aab9f8c9a96..12e188f0b788 100644 --- a/arch/arm64/kernel/mpam/mpam_ctrlmon.c +++ b/arch/arm64/kernel/mpam/mpam_ctrlmon.c @@ -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, ¶); @@ -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,
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9ARW6
-----------------------------
When a new ctrl group is created under root group, it needs to allocate a new partid for that.
After that, the piece of code also needs to make refactoring indeed.
Fixes: a8c87e34b8f3 (arm64/mpam: Expand the monitor number of the resctrl root) Signed-off-by: Zeng Heng zengheng4@huawei.com --- fs/resctrlfs.c | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-)
diff --git a/fs/resctrlfs.c b/fs/resctrlfs.c index bdb095f16f13..56f2a63ea43b 100644 --- a/fs/resctrlfs.c +++ b/fs/resctrlfs.c @@ -549,31 +549,38 @@ static int find_rdtgrp_allocable_rmid(struct resctrl_group *rdtgrp)
prgrp = rdtgrp->mon.parent;
- do { - rmid = rmid_alloc(prgrp->closid.reqpartid); - if (rmid >= 0) - break; + /* + * Create ctrl group under root group, just allocate new partid + */ + if (rdtgrp->type == RDTCTRL_GROUP) + goto rmid_realloc;
- head = &prgrp->mon.crdtgrp_list; - list_for_each_entry(entry, head, mon.crdtgrp_list) { - if (entry == rdtgrp) - continue; + rmid = rmid_alloc(prgrp->closid.reqpartid); + if (rmid >= 0) + goto rmid_attach;
- rmid = rmid_alloc(entry->closid.reqpartid); - if (rmid >= 0) - break; - } - } while (0); + head = &prgrp->mon.crdtgrp_list; + list_for_each_entry(entry, head, mon.crdtgrp_list) { + if (entry == rdtgrp) + continue;
+ rmid = rmid_alloc(entry->closid.reqpartid); + if (rmid >= 0) + goto rmid_attach; + } + +rmid_realloc: + rmid = rmid_alloc(-1); if (rmid < 0) - rmid = rmid_alloc(-1); + 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; }
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/5672 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/M...
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://gitee.com/openeuler/kernel/pulls/5672 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/M...