Re: [PATCH v6 7/9] fs/resctrl: Do not invoke smp_processor_id() in preemptible context

From: Chen, Yu C

Date: Tue Aug 25 2026 - 07:18:10 EST


On 8/20/2026 7:08 AM, Reinette Chatre wrote:
Hi Chenyu,

On 7/25/26 2:23 AM, Chen Yu wrote:
From: Tony Luck <tony.luck@xxxxxxxxx>

LLC occupancy can be read on any CPU when the counter is accessed via
MMIO, so such an event is read from task context on whatever CPU the
caller happens to be running on rather than being bounced to a CPU in
the monitoring domain. mon_evt::any_cpu marks these CPU-agnostic events.

Please let the context describe what the *current* code does. This changelog
describes context that does not exist (yet) and then presents the change in
this patch as a bugfix. This is not accurate and misrepresents this change.


OK, let me remove above description which has not yet been introduced.


__l3_mon_event_count() calls smp_processor_id() to find the CPU to read
from. For an any_cpu event that lookup is unsafe:
the code runs in preemptible task context, so smp_processor_id() emits a
debug warning.

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. For legacy MSR-based
access, update rmid_read::err if the reading of the event was dispatched to
a wrong CPU, according to the change at:
https://lore.kernel.org/lkml/6b3c66a49788828bd8c04a6911bd74c91ccd56f3.1782857711.git.reinette.chatre@xxxxxxxxx/

This has been merged now so it should not be necessary to call this out,
at least in this format

OK, I'll adjust the description to avoid mentioning the above change.

thanks,
Chenyu