Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755650Ab1BDD2w (ORCPT ); Thu, 3 Feb 2011 22:28:52 -0500 Received: from mail-gx0-f174.google.com ([209.85.161.174]:61129 "EHLO mail-gx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755529Ab1BDD2t (ORCPT ); Thu, 3 Feb 2011 22:28:49 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=PfmBM4q7cf79XH4CLLQTeBb6tdeAJJQuC6cZtbSgDgygMKvSq9FUD2usfxlhmq8o4l l9wEDlil876mU4yogjlmiTi3sM0rCTCt/xiPBTM/Zs+5Ad0UX2HeP8CJ4TPbbknhzrpX /3j6SSxKLEkYv3Bo0Ycn/uxLQn8Xm3LHNdT1s= Date: Fri, 4 Feb 2011 11:28:34 +0800 From: Yong Zhang To: Peter Zijlstra Cc: Thomas Gleixner , Tejun Heo , 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 Subject: Re: [PATCH 1/4] lockdep, timer: Fix del_timer_sync() annotation Message-ID: <20110204032834.GA2791@zhy> Reply-To: Yong Zhang References: <20110203140940.072679794@chello.nl> <20110203141548.039540914@chello.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20110203141548.039540914@chello.nl> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1636 Lines: 44 On Thu, Feb 03, 2011 at 03:09:41PM +0100, Peter Zijlstra wrote: > 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); This is more cheap than what I have done ;) I think it will cure the issue reported by Nick. Thanks you anyway. Reviewed-by: Yong Zhang -- 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/