Skip to content

Commit 0576388

Browse files
Li Huafeiingomolnar
authored andcommitted
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 <lihuafei1@huawei.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> Link: https://lore.kernel.org/r/20241021193004.308303-2-lihuafei1@huawei.com
1 parent d6834d9 commit 0576388

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

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)