Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932230Ab1BCORy (ORCPT ); Thu, 3 Feb 2011 09:17:54 -0500 Received: from casper.infradead.org ([85.118.1.10]:33157 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932274Ab1BCORw (ORCPT ); Thu, 3 Feb 2011 09:17:52 -0500 Message-Id: <20110203141548.039540914@chello.nl> User-Agent: quilt/0.48-1 Date: Thu, 03 Feb 2011 15:09:41 +0100 From: Peter Zijlstra To: Thomas Gleixner , Tejun Heo Cc: Linux Kernel Mailing List , Jens Axboe , Faisal Latif , Roland Dreier , Sean Hefty , Hal Rosenstock , Dmitry Torokhov , Alessandro Rubini , Trond Myklebust , Mark Fasheh , Joel Becker , "David S. Miller" , "John W. Linville" , Johannes Berg , Yong Zhang , Peter Zijlstra Subject: [PATCH 1/4] lockdep, timer: Fix del_timer_sync() annotation References: <20110203140940.072679794@chello.nl> Content-Disposition: inline; filename=timer-del_timer_sync.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1410 Lines: 42 Calling local_bh_enable() will want to actually start processing softirqs, which isn't a good idea since this can get called with IRQs disabled. Cure this by using _local_bh_enable() which doesn't start processing softirqs, and use raw_local_irq_save() to avoid any softirqs from happending without letting lockdep think IRQs are in fact disabled. Reported-by: Nick Bowler Signed-off-by: Peter Zijlstra LKML-Reference: --- kernel/timer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) Index: linux-2.6/kernel/timer.c =================================================================== --- linux-2.6.orig/kernel/timer.c +++ linux-2.6/kernel/timer.c @@ -969,10 +969,14 @@ EXPORT_SYMBOL(try_to_del_timer_sync); int del_timer_sync(struct timer_list *timer) { #ifdef CONFIG_LOCKDEP + unsigned long flags; + + raw_local_irq_save(flags); local_bh_disable(); lock_map_acquire(&timer->lockdep_map); lock_map_release(&timer->lockdep_map); - local_bh_enable(); + _local_bh_enable(); + raw_local_irq_restore(flags); #endif /* * don't use it in hardirq context, because it -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/