Re: [PATCH v5 08/10] fs/resctrl: Do not invoke smp_processor_id() in preemptible context

From: Reinette Chatre

Date: Fri Jul 10 2026 - 19:48:23 EST


Hi Chenyu,

On 7/1/26 6:47 AM, Chen Yu wrote:
> From: Tony Luck <tony.luck@xxxxxxxxx>
>
> Currently, mon_evt::any_cpu is false for all events associated with
> RDT_RESOURCE_L3. The MMIO-based CMT will set any_cpu to true in a
> follow-up patch. This change will trigger a warning when calling

Please drop the "in a follow-up patch" since that becomes irrelevant after
merge. Also please rewrite this paragraph to not just describe code but
what this actually means at a high level.

> smp_processor_id() inside __l3_mon_event_count(), because
> __l3_mon_event_count() may be invoked from arbitrary CPUs in task
> context. Since the calling context is preemptible here,
> smp_processor_id() will emit a debug warning.
>
> To prepare for MMIO-based CMT reads, skip the current CPU lookup
> when an event's any_cpu flag is set. Events with this flag do not
> require execution on a specific CPU.

Please note there is an upcoming change that will impact this change.
Nothing major, the change should be clear.
https://lore.kernel.org/lkml/6b3c66a49788828bd8c04a6911bd74c91ccd56f3.1782857711.git.reinette.chatre@xxxxxxxxx/

Reinette