linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / 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	[thread overview]
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	other threads:[~2017-08-28 12:42 UTC|newest]

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 mixed read-write ABBA tests 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
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;
as well as URLs for NNTP newsgroup(s).