LKML Archive on lore.kernel.org
 help / color / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org,
	mingo@kernel.org, hpa@zytor.com, tglx@linutronix.de
Cc: linux-tip-commits@vger.kernel.org
Subject: Re: [tip:locking/core] locking/lockdep/selftests: Add mixed read-write ABBA tests
Date: Mon, 28 Aug 2017 14:42:45 +0200
Message-ID: <20170828124245.xlo2yshxq2btgmuf@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <tip-e91498589746065e3ae95d9a00b068e525eec34f@git.kernel.org>

On Fri, Aug 25, 2017 at 04:55:48AM -0700, tip-bot for Peter Zijlstra wrote:
> Commit-ID:  e91498589746065e3ae95d9a00b068e525eec34f
> Gitweb:     http://git.kernel.org/tip/e91498589746065e3ae95d9a00b068e525eec34f
> Author:     Peter Zijlstra <peterz@infradead.org>
> AuthorDate: Wed, 23 Aug 2017 13:13:11 +0200
> Committer:  Ingo Molnar <mingo@kernel.org>
> CommitDate: Fri, 25 Aug 2017 11:06:31 +0200
> 
> locking/lockdep/selftests: Add mixed read-write ABBA tests
> 
> Currently lockdep has limited support for recursive readers, add a few
> mixed read-write ABBA selftests to show the extend of these
> limitations.
> 
>   [    0.000000] ----------------------------------------------------------------------------
>   [    0.000000]                                  | spin |wlock |rlock |mutex | wsem | rsem |
>   [    0.000000]   --------------------------------------------------------------------------
> 
>   [    0.000000]   mixed read-lock/lock-write ABBA:             |FAILED|             |  ok  |
>   [    0.000000]    mixed read-lock/lock-read ABBA:             |  ok  |             |  ok  |
>   [    0.000000]  mixed write-lock/lock-write ABBA:             |  ok  |             |  ok  |
> 
> This clearly illustrates the case where lockdep fails to find a
> deadlock.
> 

I'm an idiot...  this patch kills lockdep.

We want something like so on top.

---
 lib/locking-selftest.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/locking-selftest.c b/lib/locking-selftest.c
index 3c7151a6cd98..cd0b5c964bd0 100644
--- a/lib/locking-selftest.c
+++ b/lib/locking-selftest.c
@@ -2031,6 +2031,12 @@ void locking_selftest(void)
 	print_testname("mixed read-lock/lock-write ABBA");
 	pr_cont("             |");
 	dotest(rlock_ABBA1, FAILURE, LOCKTYPE_RWLOCK);
+	/*
+	 * Lockdep does indeed fail here, but there's nothing we can do about
+	 * that now.  Don't kill lockdep for it.
+	 */
+	unexpected_testcase_failures--;
+
 	pr_cont("             |");
 	dotest(rwsem_ABBA1, FAILURE, LOCKTYPE_RWSEM);
 

       reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <tip-e91498589746065e3ae95d9a00b068e525eec34f@git.kernel.org>
2017-08-28 12:42 ` Peter Zijlstra [this message]
2017-08-29 14:25   ` [tip:locking/core] locking/lockdep/selftests: Fix " tip-bot for Peter Zijlstra

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=20170828124245.xlo2yshxq2btgmuf@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /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

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git