Skip to content

Commit

Permalink
timer: Warn when del_timer_sync() is called in hardirq context
Browse files Browse the repository at this point in the history
Add explict warning when del_timer_sync() is called in hardirq
context.

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Yong Zhang authored and Thomas Gleixner committed Oct 22, 2010
1 parent 1118e2c commit 466bd30
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kernel/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,11 @@ int del_timer_sync(struct timer_list *timer)
lock_map_release(&timer->lockdep_map);
local_bh_enable();
#endif

/*
* don't use it in hardirq context, because it
* could lead to deadlock.
*/
WARN_ON(in_irq());
for (;;) {
int ret = try_to_del_timer_sync(timer);
if (ret >= 0)
Expand Down

0 comments on commit 466bd30

Please sign in to comment.