+ timer-warn-when-del_timer_sync-used-in-hardirq-context.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     timer: warn when del_timer_sync() used in hardirq context
has been added to the -mm tree.  Its filename is
     timer-warn-when-del_timer_sync-used-in-hardirq-context.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: timer: warn when del_timer_sync() used in hardirq context
From: Yong Zhang <yong.zhang@xxxxxxxxxxxxx>

Add explict warning to prevent del_timer_sync() from using in hardirq
context.

Signed-off-by: Yong Zhang <yong.zhang0@xxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Acked-by: Oleg Nesterov <oleg@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 kernel/timer.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff -puN kernel/timer.c~timer-warn-when-del_timer_sync-used-in-hardirq-context kernel/timer.c
--- a/kernel/timer.c~timer-warn-when-del_timer_sync-used-in-hardirq-context
+++ a/kernel/timer.c
@@ -994,7 +994,11 @@ int del_timer_sync(struct timer_list *ti
 	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)
_

Patches currently in -mm which might be from yong.zhang@xxxxxxxxxxxxx are

linux-next.patch
timer-make-try_to_del_timer_sync-safe-on-both-hardirq-context-and-up.patch
timer-del_timer_sync-can-be-used-in-softirq-context.patch
timer-warn-when-del_timer_sync-used-in-hardirq-context.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux