All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [tip:locking/core] locking/lockdep/selftests: Add mixed read-write ABBA tests
       [not found] <tip-e91498589746065e3ae95d9a00b068e525eec34f@git.kernel.org>
@ 2017-08-28 12:42 ` Peter Zijlstra
  2017-08-29 14:25   ` [tip:locking/core] locking/lockdep/selftests: Fix " tip-bot for Peter Zijlstra
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Zijlstra @ 2017-08-28 12:42 UTC (permalink / raw)
  To: torvalds, linux-kernel, mingo, hpa, tglx; +Cc: linux-tip-commits

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [tip:locking/core] locking/lockdep/selftests: Fix mixed read-write ABBA tests
  2017-08-28 12:42 ` [tip:locking/core] locking/lockdep/selftests: Add mixed read-write ABBA tests Peter Zijlstra
@ 2017-08-29 14:25   ` tip-bot for Peter Zijlstra
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Peter Zijlstra @ 2017-08-29 14:25 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: mingo, torvalds, tglx, linux-kernel, hpa, peterz

Commit-ID:  d82fed75294229abc9d757f08a4817febae6c4f4
Gitweb:     http://git.kernel.org/tip/d82fed75294229abc9d757f08a4817febae6c4f4
Author:     Peter Zijlstra <peterz@infradead.org>
AuthorDate: Mon, 28 Aug 2017 14:42:45 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 29 Aug 2017 15:15:17 +0200

locking/lockdep/selftests: Fix mixed read-write ABBA tests

Commit:

  e91498589746 ("locking/lockdep/selftests: Add mixed read-write ABBA tests")

adds an explicit FAILURE to the locking selftest but overlooked the
fact that this kills lockdep. Fudge the test to avoid this.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: hpa@zytor.com
Link: http://lkml.kernel.org/r/20170828124245.xlo2yshxq2btgmuf@hirez.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 lib/locking-selftest.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/locking-selftest.c b/lib/locking-selftest.c
index 3c7151a..cd0b5c9 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);
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-29 14:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <tip-e91498589746065e3ae95d9a00b068e525eec34f@git.kernel.org>
2017-08-28 12:42 ` [tip:locking/core] locking/lockdep/selftests: Add mixed read-write ABBA tests Peter Zijlstra
2017-08-29 14:25   ` [tip:locking/core] locking/lockdep/selftests: Fix " tip-bot for Peter Zijlstra

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.