LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Yong Zhang <yong.zhang0@gmail.com>
Cc: Nick Bowler <nbowler@elliptictech.com>,
	linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: Regression: WARNINGS and lockdep spews in 2.6.38-rc3+ (bisected).
Date: Tue, 08 Feb 2011 17:55:27 +0100	[thread overview]
Message-ID: <1297184127.13327.142.camel@laptop> (raw)
In-Reply-To: <20110203114218.GA1809@zhy>

On Thu, 2011-02-03 at 19:42 +0800, Yong Zhang wrote:
> My patch is inspired by this http://lkml.org/lkml/2010/8/16/291

Right, so that splat warns about:

spin_lock_irqsave(&shost->host_lock);
del_timer_sync()
  spin_lock_irqsave(&t->split_timeout_timer);

vs

<SOFTIRQ>
  call_timer_fn()
    spin_lock(&t->split_timeout_timer);
    <IRQ>
      spin_lock_irqsave(&shost->host_lock);

Which Steven just pointed out is an actual deadlock because:


CPU0					CPU1
spin_lock_irqsave(&shost->host_lock);
					<SOFTIRQ>
					  call_timer_fn();
					    base->running_timer = timer;
					    func();
					      <IRQ>
						spin_lock(&shost->host_lock);
del_timer_sync()
  while(base->running_timer == timer);

And the world stops turning..


Also note that your patch changes the above to:

spin_lock_irqsave(&shost->host_lock);
del_timer_sync()
  spin_lock_bh(&t->split_timeout_timer);

Which wouldn't make one bit of difference.


  reply	other threads:[~2011-02-08 16:54 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
2011-02-03 10:33       ` Peter Zijlstra
2011-02-03 11:42         ` Yong Zhang
2011-02-08 16:55           ` Peter Zijlstra [this message]
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=1297184127.13327.142.camel@laptop \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nbowler@elliptictech.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=yong.zhang0@gmail.com \
    --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).