]> exis.tech > repos - linux.git/commit
rv: Add automatic cleanup handlers for per-task HA monitors
authorGabriele Monaco <gmonaco@redhat.com>
Mon, 1 Jun 2026 15:38:34 +0000 (17:38 +0200)
committerGabriele Monaco <gmonaco@redhat.com>
Wed, 3 Jun 2026 10:33:24 +0000 (12:33 +0200)
commit700782ec8f6589c5792b323efd6e004dd183328b
tree4990aef64666b82a230056f6ff8f220dc2c44008
parent713c9e1ea7623846f8e0bb657f1b9d211d1a61e6
rv: Add automatic cleanup handlers for per-task HA monitors

Hybrid automata monitors may start timers, depending on the model, these
may remain active on an exiting task and cause false positives or even
access freed memory.

Add an enable/disable hook in the HA code, currently only populated by
the per-task handler for registration and deregistration.
This hooks to the sched_process_exit event and ensures the timer is
stopped for every exiting task. The handler is enabled automatically but
may be disabled, for instance if the monitor uses the event for another
purpose (but should still manually ensure timers are stopped).

Fixes: f5587d1b6ec9 ("rv: Add Hybrid Automata monitor type")
Reviewed-by: Nam Cao <namcao@linutronix.de>
Link: https://lore.kernel.org/r/20260601153840.124372-8-gmonaco@redhat.com
Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
include/rv/ha_monitor.h
kernel/trace/rv/monitors/nomiss/nomiss.c
kernel/trace/rv/monitors/opid/opid.c
kernel/trace/rv/monitors/stall/stall.c
tools/verification/rvgen/rvgen/templates/dot2k/main.c