public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Mike Galbraith <umgwanakikbuti@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	linux-rt-users <linux-rt-users@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: Re: [btrfs/rt] lockdep false positive
Date: Mon, 23 Jan 2017 10:07:51 +0100	[thread overview]
Message-ID: <20170123090751.GU6485@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <1485107114.4467.73.camel@gmail.com>

On Sun, Jan 22, 2017 at 06:45:14PM +0100, Mike Galbraith wrote:
> On Sun, 2017-01-22 at 09:46 +0100, Mike Galbraith wrote:
> > Greetings btrfs/lockdep wizards,
> > 
> > RT trees have trouble with the BTRFS lockdep positive avoidance lock
> > class dance (see disk-io.c).  Seems the trouble is due to RT not having
> > a means of telling lockdep that its rwlocks are recursive for read by
> > the lock owner only, combined with the BTRFS lock class dance assuming
> > that read_lock() is annotated rwlock_acquire_read(), which RT cannot
> > do, as that would be a big fat lie.
> > 
> > Creating a rt_read_lock_shared() for btrfs_clear_lock_blocking_rw() did
> > indeed make lockdep happy as a clam for test purposes.  (hm, submitting
> > that would be excellent way to replenish frozen shark supply:)
> > 
> > Ideas?

Not having looked at anything much, currently lockdep does not in fact
model rwlock properly as is.

Note that rwlock is _not_ in fact reader biased like it used to be, that
is, read_lock() will block if there is a pending writer (just like
rwsem), with the exception when read_lock() happend in_interrupt()
(because tasklist_lock).

  parent reply	other threads:[~2017-01-23  9:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-22  8:46 [btrfs/rt] lockdep false positive Mike Galbraith
2017-01-22 17:45 ` Mike Galbraith
2017-01-22 18:25   ` Mike Galbraith
2017-01-23  5:23   ` Mike Galbraith
2017-01-23  9:07   ` Peter Zijlstra [this message]
2017-01-25 17:02   ` Sebastian Andrzej Siewior
2017-01-25 18:29     ` Mike Galbraith
2017-01-26 17:09       ` Sebastian Andrzej Siewior
2017-01-26 18:01         ` Mike Galbraith

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=20170123090751.GU6485@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bigeasy@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=umgwanakikbuti@gmail.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox