Re: [PATCH v11 10/31] x86,fs/resctrl: Handle events that can be read from any CPU
From: Reinette Chatre
Date: Fri Oct 03 2025 - 19:33:13 EST
Hi Tony,
On 9/25/25 1:03 PM, Tony Luck wrote:
> resctrl assumes that monitor events can only be read from a CPU in the
> cpumask_t set of each domain. This is true for x86 events accessed
> with an MSR interface, but may not be true for other access methods such
> as MMIO.
>
> Add a flag to struct mon_evt, settable by architecture code, to indicate
"Add a flag to struct mon_evt" -> "Add flag mon_evt::any_cpu"
> there are no restrictions on which CPU can read that event.
Or rather:
Introduce and use flag mon_evt::any_cpu, settable by architecture,
that indicates there are no restrictions on which CPU can read that
event.
>
> Bypass all the smp_call*() code for events that can be read on any CPU
> and call mon_event_count() directly from mon_event_read().
Above (from "Bypass ...") can be dropped since it is clear from patch.
>
> Simplify CPU checking in __mon_event_count() with a helper.
Above can be seen from patch but when trying to do so it is not clear
why this helper is needed and indicates that this is missing "why".
Proposal:
Refactor the CPU checking to avoid always calling smp_processor_id()
now that events can be read from preemptible context.
>
> Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx>
> ---
Reinette