The patch titled timer: del_timer_sync() can be used in softirq context has been added to the -mm tree. Its filename is timer-del_timer_sync-can-be-used-in-softirq-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: del_timer_sync() can be used in softirq context From: Yong Zhang <yong.zhang@xxxxxxxxxxxxx> Actually we have used del_timer_sync() in softirq context for a long time, such as: __dst_free()::cancel_delayed_work() and maybe the DEBUG_OBJECTS_TIMERS fundamental code. So change the comments of it to warn on hardirq context only, and make lockdep know about this change. Signed-off-by: Yong Zhang <yong.zhang0@xxxxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxx> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx> Cc: Oleg Nesterov <oleg@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/timer.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff -puN kernel/timer.c~timer-del_timer_sync-can-be-used-in-softirq-context kernel/timer.c --- a/kernel/timer.c~timer-del_timer_sync-can-be-used-in-softirq-context +++ a/kernel/timer.c @@ -979,7 +979,7 @@ EXPORT_SYMBOL(try_to_del_timer_sync); * * Synchronization rules: Callers must prevent restarting of the timer, * otherwise this function is meaningless. It must not be called from - * interrupt contexts. The caller must not hold locks which would prevent + * hardirq contexts. The caller must not hold locks which would prevent * completion of the timer's handler. The timer's handler must not call * add_timer_on(). Upon exit the timer is not queued and the handler is * not running on any CPU. @@ -989,12 +989,10 @@ EXPORT_SYMBOL(try_to_del_timer_sync); int del_timer_sync(struct timer_list *timer) { #ifdef CONFIG_LOCKDEP - unsigned long flags; - - local_irq_save(flags); + local_bh_disable(); lock_map_acquire(&timer->lockdep_map); lock_map_release(&timer->lockdep_map); - local_irq_restore(flags); + local_bh_enable(); #endif for (;;) { _ 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