]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rv: Ensure all pending probes terminate on per-obj monitor destroy
authorGabriele Monaco <gmonaco@redhat.com>
Mon, 1 Jun 2026 15:38:31 +0000 (17:38 +0200)
committerGabriele Monaco <gmonaco@redhat.com>
Wed, 3 Jun 2026 10:33:24 +0000 (12:33 +0200)
The monitor disable/destroy sequence detaches all probes and resets the
monitor's data, however it doesn't wait for pending probes. This is an
issue with per-object monitors, which free the monitor storage.

Call tracepoint_synchronize_unregister() to make sure to wait for all
pending probes before destroying the monitor storage.

Fixes: 4a24127bd6cb ("rv: Add support for per-object monitors in DA/HA")
Reviewed-by: Wen Yang <wen.yang@linux.dev>
Reviewed-by: Nam Cao <namcao@linutronix.de>
Link: https://lore.kernel.org/r/20260601153840.124372-5-gmonaco@redhat.com
Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
include/rv/da_monitor.h

index cc97cc5dfbfd813ae07dba4b0c1a01976b5c5bd8..a7e10365440661ffbc2e77bbf4a3f3fc184b92aa 100644 (file)
@@ -511,9 +511,10 @@ static inline void da_monitor_destroy(void)
        struct hlist_node *tmp;
        int bkt;
 
+       tracepoint_synchronize_unregister();
        /*
-        * This function is called after all probes are disabled, we need only
-        * worry about concurrency against old events.
+        * This function is called after all probes are disabled and no longer
+        * pending, we can safely assume no concurrent user.
         */
        synchronize_rcu();
        hash_for_each_safe(da_monitor_ht, bkt, tmp, mon_storage, node) {