Skip to content

Commit 0576388

Browse files
Li HuafeiIngo Molnar
Li Huafei
authored and
Ingo Molnar
committed
watchdog/hardlockup/perf: Warn if watchdog_ev is leaked
When creating a new perf_event for the hardlockup watchdog, it should not happen that the old perf_event is not released. Introduce a WARN_ONCE() that should never trigger. [ mingo: Changed the type of the warning to WARN_ONCE(). ] Signed-off-by: Li Huafei <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d6834d9 commit 0576388

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/watchdog_perf.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ static int hardlockup_detector_event_create(void)
144144
PTR_ERR(evt));
145145
return PTR_ERR(evt);
146146
}
147+
WARN_ONCE(this_cpu_read(watchdog_ev), "unexpected watchdog_ev leak");
147148
this_cpu_write(watchdog_ev, evt);
148149
return 0;
149150
}

0 commit comments

Comments
 (0)