diff options
author | Yong Zhang <yong.zhang@windriver.com> | 2010-10-20 15:57:33 -0700 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2010-10-22 14:46:25 +0200 |
commit | 466bd3030973910118ca601da8072be97a1e2209 (patch) | |
tree | 70194e60d4054d045f35e29ee4fcd2230c2622dc /kernel | |
parent | 1118e2cd33d47254854e1ba3ba8e32802ff14fdf (diff) |
timer: Warn when del_timer_sync() is called in hardirq context
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>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/timer.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/timer.c b/kernel/timer.c index 612de0306e7..483e54ba5c9 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -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) |