milos-linux/include/rv
Gabriele Monaco 7c147fae71 rv: Prevent task migration while handling per-CPU events
Tracepoint handlers are fully preemptible after a46023d561 ("tracing:
Guard __DECLARE_TRACE() use of __DO_TRACE_CALL() with SRCU-fast"). When
a per-CPU monitor handles an event, it retrieves the monitor state using
a per-CPU pointer. If the event itself doesn't disable preemption, the
task can migrate to a different CPU and we risk updating the wrong
monitor.

Mitigate this by explicitly disabling task migration before acquiring
the monitor pointer. This cannot guarantee the monitor runs on the
correct CPU but reduces the race condition window and prevents warnings.

Reviewed-by: Wen Yang <wen.yang@linux.dev>
Reviewed-by: Nam Cao <namcao@linutronix.de>
Link: https://lore.kernel.org/r/20260601153840.124372-10-gmonaco@redhat.com
Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
2026-06-03 12:33:25 +02:00
..
automata.h rv: Cleanup da_monitor after refactor 2026-01-12 07:43:49 +01:00
da_monitor.h rv: Prevent task migration while handling per-CPU events 2026-06-03 12:33:25 +02:00
ha_monitor.h rv: Ensure synchronous cleanup for HA monitors 2026-06-03 12:33:25 +02:00
instrumentation.h rv/include: Add instrumentation helper functions 2022-07-30 14:01:28 -04:00
ltl_monitor.h rv: Prevent in-flight per-task handlers from using invalid slots 2026-06-03 12:33:23 +02:00