[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1282633129-9187-4-git-send-email-yong.zhang0@gmail.com>
Date: Tue, 24 Aug 2010 14:58:49 +0800
From: Yong Zhang <yong.zhang0@...il.com>
To: linux-kernel@...r.kernel.org
Cc: tglx@...utronix.de, akpm@...ux-foundation.org, mingo@...e.hu,
peterz@...radead.org, oleg@...hat.com
Subject: [RFC PATCH 3/3] timer: warn when del_timer_sync() used in hardirq context
From: Yong Zhang <yong.zhang@...driver.com>
Add explict warning to prevent del_timer_sync() from using
in hardirq context.
Signed-off-by: Yong Zhang <yong.zhang0@...il.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Ingo Molnar <mingo@...e.hu>
---
kernel/timer.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/kernel/timer.c b/kernel/timer.c
index 08c9559..1bc4b4a 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -996,7 +996,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)
--
1.7.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists