mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 07:03:03 +02:00
x86/resctrl: Modify update_mba_bw() to use per CTRL_MON group event
update_mba_bw() hard codes use of the memory bandwidth local event which prevents more flexible options from being deployed. Change this function to use the event specified in the rdtgroup that is being processed. Mount time checks for the "mba_MBps" option ensure that local memory bandwidth is enabled. So drop the redundant is_mbm_local_enabled() check. Signed-off-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Tested-by: Babu Moger <babu.moger@amd.com> Link: https://lore.kernel.org/r/20241206163148.83828-4-tony.luck@intel.com
This commit is contained in:
parent
3b49c37a2f
commit
481d363748
|
|
@ -752,20 +752,20 @@ static void update_mba_bw(struct rdtgroup *rgrp, struct rdt_mon_domain *dom_mbm)
|
|||
u32 closid, rmid, cur_msr_val, new_msr_val;
|
||||
struct mbm_state *pmbm_data, *cmbm_data;
|
||||
struct rdt_ctrl_domain *dom_mba;
|
||||
enum resctrl_event_id evt_id;
|
||||
struct rdt_resource *r_mba;
|
||||
u32 cur_bw, user_bw, idx;
|
||||
struct list_head *head;
|
||||
struct rdtgroup *entry;
|
||||
|
||||
if (!is_mbm_local_enabled())
|
||||
return;
|
||||
u32 cur_bw, user_bw;
|
||||
|
||||
r_mba = &rdt_resources_all[RDT_RESOURCE_MBA].r_resctrl;
|
||||
evt_id = rgrp->mba_mbps_event;
|
||||
|
||||
closid = rgrp->closid;
|
||||
rmid = rgrp->mon.rmid;
|
||||
idx = resctrl_arch_rmid_idx_encode(closid, rmid);
|
||||
pmbm_data = &dom_mbm->mbm_local[idx];
|
||||
pmbm_data = get_mbm_state(dom_mbm, closid, rmid, evt_id);
|
||||
if (WARN_ON_ONCE(!pmbm_data))
|
||||
return;
|
||||
|
||||
dom_mba = get_ctrl_domain_from_cpu(smp_processor_id(), r_mba);
|
||||
if (!dom_mba) {
|
||||
|
|
@ -784,7 +784,9 @@ static void update_mba_bw(struct rdtgroup *rgrp, struct rdt_mon_domain *dom_mbm)
|
|||
*/
|
||||
head = &rgrp->mon.crdtgrp_list;
|
||||
list_for_each_entry(entry, head, mon.crdtgrp_list) {
|
||||
cmbm_data = &dom_mbm->mbm_local[entry->mon.rmid];
|
||||
cmbm_data = get_mbm_state(dom_mbm, entry->closid, entry->mon.rmid, evt_id);
|
||||
if (WARN_ON_ONCE(!cmbm_data))
|
||||
return;
|
||||
cur_bw += cmbm_data->prev_bw;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user