LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Yong Zhang <yong.zhang0@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	x86@kernel.org, tglx <tglx@linutronix.de>,
	Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: [PATCH 2/2] timer: use local_bh_enable_force_wake() in del_timer_sync()
Date: Tue, 8 Feb 2011 20:14:10 +0800	[thread overview]
Message-ID: <20110208121410.GB4824@zhy> (raw)
In-Reply-To: <20110208121108.GA4824@zhy>

From: Yong Zhang <yong.zhang0@gmail.com>
Subject: [PATCH 2/2] timer: use local_bh_enable_force_wake() in del_timer_sync()

raw_local_irq_save()/raw_local_irq_restore() is also not suitable
here because lockdep will report "possible reason: unannotated irqs-off"

To cure this issue, use local_bh_enable_force_wake() here in case of
we have pending softirq left during this time.

Reported-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
 kernel/timer.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/kernel/timer.c b/kernel/timer.c
index d53ce66..1654dc1 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -969,14 +969,10 @@ 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();
-	raw_local_irq_restore(flags);
+	local_bh_enable_force_wake();
 #endif
 	/*
 	 * don't use it in hardirq context, because it
-- 
1.7.1

  reply	other threads:[~2011-02-08 12:14 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-08  0:23 Linux 2.6.38-rc4 Linus Torvalds
2011-02-08 10:17 ` lockdep: possible reason: unannotated irqs-off. (was: Re: Linux 2.6.38-rc4) Borislav Petkov
2011-02-08 10:41   ` Peter Zijlstra
2011-02-08 12:11     ` Yong Zhang
2011-02-08 12:14       ` Yong Zhang [this message]
2011-02-08 13:34       ` Yong Zhang
2011-02-08 13:48         ` Peter Zijlstra
2011-02-08 14:18           ` Peter Zijlstra
2011-02-08 15:15             ` Ingo Molnar
2011-02-08 15:51             ` [tip:core/urgent] Revert "lockdep, timer: Fix del_timer_sync() annotation" tip-bot for Peter Zijlstra
2011-02-09  1:46             ` lockdep: possible reason: unannotated irqs-off. (was: Re: Linux 2.6.38-rc4) Yong Zhang
2011-02-14 14:51             ` Yong Zhang
2011-02-14 18:53               ` Thomas Gleixner
2011-02-08 20:28 ` Heads up Linux 2.6.38-rc4 compile problems Eric W. Biederman
2011-02-08 20:44   ` Linus Torvalds
2011-02-09  9:01     ` Eric W. Biederman
2011-02-09 14:59       ` Alex Riesen
2011-02-09 16:02         ` Linus Torvalds
2011-02-13 17:39           ` Linus Torvalds
2011-02-14  2:04             ` Eric W. Biederman
2011-02-14  2:45               ` Linus Torvalds
2011-02-14  3:40                 ` Eric W. Biederman
2011-02-14  5:34                   ` Eric W. Biederman
2011-02-14 15:26                     ` Linus Torvalds
2011-02-14 15:37                     ` Eric W. Biederman
2011-02-14 16:37                       ` Linus Torvalds
2011-02-14 17:39                         ` Eric W. Biederman
2011-02-14 17:49                         ` Linus Torvalds
2011-02-14 18:08                           ` Linus Torvalds
2011-02-14 19:44                             ` Eric W. Biederman
2011-02-14 20:13                               ` Andrew Morton
2011-02-14 18:25                         ` Andi Kleen
2011-02-14 16:58                     ` Mike Snitzer
2011-02-15 14:07                       ` [Crash-utility] " Dave Anderson
2011-02-09 17:08 ` Linux 2.6.38-rc4 (test_nx: BUG) Randy Dunlap
2011-02-09 17:10   ` Arjan van de Ven
2011-02-17 19:33     ` Kees Cook
2011-02-09 17:24 ` Linux 2.6.38-rc4 (hysdn: BUG) Randy Dunlap
2011-02-09 19:44   ` Linus Torvalds
2011-02-09 21:25     ` Randy Dunlap
2011-02-09 21:57       ` David Miller
2011-02-09 22:00         ` Linus Torvalds
2011-02-09 17:26 ` Linux 2.6.38-rc4 (tty/ifx6x60: BUG) Randy Dunlap
2011-02-09 18:28   ` Alan Cox
2011-02-09 17:28 ` Linux 2.6.38-rc4 (target_core: rmmod GP fault) Randy Dunlap
2011-02-09 19:00   ` Linus Torvalds
2011-02-09 20:02     ` Nicholas A. Bellinger
2011-02-09 20:13       ` James Bottomley
2011-02-09 20:20         ` Nicholas A. Bellinger
2011-02-09 20:28           ` James Bottomley
2011-02-09 20:44             ` Nicholas A. Bellinger
2011-02-09 17:36 ` Linux 2.6.38-rc4 (other bugs) Randy Dunlap
2011-02-09 22:01   ` David Miller
2011-02-09 22:16     ` Randy Dunlap
2011-02-10  4:58     ` Linux 2.6.38-rc4 (other bugs: x25) Randy Dunlap
2011-02-10  5:48       ` David Miller
2011-02-10  6:29         ` Randy Dunlap
2011-02-10  6:35           ` David Miller
2011-02-10 19:34   ` Linux 2.6.38-rc4 (other bugs: ipmi Oops) Randy Dunlap
2011-02-10 20:03     ` Linus Torvalds
2011-02-10 20:08       ` Corey Minyard
2011-02-10 21:41       ` Randy Dunlap
  -- strict thread matches above, loose matches on Subject: below --
2011-02-03  3:19 Regression: WARNINGS and lockdep spews in 2.6.38-rc3+ (bisected) Nick Bowler
2011-02-03  9:12 ` Yong Zhang
2011-02-03  9:30   ` Peter Zijlstra
2011-02-03 10:17     ` Yong Zhang
2011-02-03 11:53       ` [PATCH 2/2] timer: use local_bh_enable_force_wake() in del_timer_sync() Yong Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110208121410.GB4824@zhy \
    --to=yong.zhang0@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    --subject='Re: [PATCH 2/2] timer: use local_bh_enable_force_wake() in del_timer_sync()' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).