diff options
author | Yong Zhang <[email protected]> | 2010-10-20 15:57:33 -0700 |
---|---|---|
committer | Thomas Gleixner <[email protected]> | 2010-10-22 14:46:25 +0200 |
commit | 466bd3030973910118ca601da8072be97a1e2209 (patch) | |
tree | 70194e60d4054d045f35e29ee4fcd2230c2622dc | |
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 <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Acked-by: Oleg Nesterov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
-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 612de0306e79..483e54ba5c93 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) |