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: Nick Bowler <nbowler@elliptictech.com>,
	linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: Regression: WARNINGS and lockdep spews in 2.6.38-rc3+ (bisected).
Date: Thu, 3 Feb 2011 18:17:39 +0800	[thread overview]
Message-ID: <20110203101739.GA1551@zhy> (raw)
In-Reply-To: <1296725440.26581.354.camel@laptop>

On Thu, Feb 03, 2011 at 10:30:40AM +0100, Peter Zijlstra wrote:
> On Thu, 2011-02-03 at 17:12 +0800, Yong Zhang wrote:
> >  #ifdef CONFIG_LOCKDEP
> > +       unsigned long flags;
> > +
> >         local_bh_disable();
> >         lock_map_acquire(&timer->lockdep_map);
> >         lock_map_release(&timer->lockdep_map);
> > -       local_bh_enable();
> > +       /* raw_local_irq_[save|restore] is to protect _local_bh_enable() */
> > +       raw_local_irq_save(flags);
> > +       _local_bh_enable();
> > +       raw_local_irq_restore(flags);
> >  #endif 
> 
> _why_ are you doing the raw_local_irq stuff? That's just weird, and that
> comment isn't helping.

Just to avoid trigger WARN_ON_ONCE(!irqs_disabled()) in __local_bh_enable(),

> 
> Also, calling _local_bh_enable() will leave pending softirqs, not
> particularly nice

Ah, indeed. That's bad.

Now I'm not sure how to work around this issue, because local_bh_enable()
and _local_bh_enable() are not suitable here.

Maybe we can introduce another type of local_bh_enable() in which
waking up ksoftirqd is forced if needed.

Thanks,
Yong

  reply	other threads:[~2011-02-03 10:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-03  3:19 Nick Bowler
2011-02-03  9:12 ` Yong Zhang
2011-02-03  9:30   ` Peter Zijlstra
2011-02-03 10:17     ` Yong Zhang [this message]
2011-02-03 10:33       ` Peter Zijlstra
2011-02-03 11:42         ` Yong Zhang
2011-02-08 16:55           ` Peter Zijlstra
2011-02-08 17:39             ` [PATCH] lockdep/timers: Explain in detail the locking problems del_timer_sync() may cause Steven Rostedt
2011-02-16 13:51               ` [tip:core/locking] " tip-bot for Steven Rostedt
2011-02-03 11:50       ` [PATCH 1/2] softirq: introduce loacal_bh_enable_force_wake() 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=20110203101739.GA1551@zhy \
    --to=yong.zhang0@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nbowler@elliptictech.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --subject='Re: Regression: WARNINGS and lockdep spews in 2.6.38-rc3+ (bisected).' \
    /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).