Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1721587

Re: [tip:locking/core] locking/lockdep/selftests: Add mixed read-write ABBA tests

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [tip:locking/core] locking/lockdep/selftests: Add mixed read-write ABBA tests
Date 2017-08-28 14:50 +0200
Message-ID <ujrEm-5DK-19@gated-at.bofh.it> (permalink)
References <ujrEm-5DK-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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);
 

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [tip:locking/core] locking/lockdep/selftests: Add mixed  read-write ABBA tests Peter Zijlstra <peterz@infradead.org> - 2017-08-28 14:50 +0200
  [tip:locking/core] locking/lockdep/selftests: Fix mixed read-write  ABBA tests tip-bot for Peter Zijlstra <tipbot@zytor.com> - 2017-08-29 16:30 +0200

csiph-web