Re: [PATCH v1 8/9] x86/resctrl: Use mbm_update() to push soft RMID counts

Reinette Chatre
2023-05-11T21:41:00Z

Hi Peter,

On 4/21/2023 7:17 AM, Peter Newman wrote:
> @@ -806,12 +811,27 @@ void mbm_handle_overflow(struct work_struct *work)
> r = &rdt_resources_all[RDT_RESOURCE_L3].r_resctrl;
> d = container_of(work, struct rdt_domain, mbm_over.work);
>
> + if (rdt_mon_soft_rmid) {
> + /*
> + * HW RMIDs are permanently assigned to CPUs, so only a per-CPU
> + * flush is needed.
> + */
> + on_each_cpu_mask(&d->cpu_mask, mbm_flush_cpu_handler, NULL,
> + false);
> + }
> +
> list_for_each_entry(prgrp, &rdt_all_groups, rdtgroup_list) {
> - mbm_update(r, d, prgrp->mon.rmid);
> + /*
> + * mbm_update() on every RMID would result in excessive IPIs
> + * when RMIDs are soft.
> + */
> + if (!rdt_mon_soft_rmid) {
> + mbm_update(r, d, prgrp->mon.rmid);
>
> - head = &prgrp->mon.crdtgrp_list;
> - list_for_each_entry(crgrp, head, mon.crdtgrp_list)
> - mbm_update(r, d, crgrp->mon.rmid);
> + head = &prgrp->mon.crdtgrp_list;
> + list_for_each_entry(crgrp, head, mon.crdtgrp_list)
> + mbm_update(r, d, crgrp->mon.rmid);
> + }
>
> if (is_mba_sc(NULL))
> update_mba_bw(prgrp, d);

hmmm ... I think that update_mba_bw() relies on mbm_update() to call
mbm_bw_count() to update the data it depends on. Keeping update_mba_bw()
while dropping mbm_update() thus seems problematic. AMD does not support the
software controller though so it may make things simpler if support for
software RMIDs disables support for software controller (in a clear way).

Reinette