[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170828124245.xlo2yshxq2btgmuf@hirez.programming.kicks-ass.net>
Date: Mon, 28 Aug 2017 14:42:45 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: torvalds@...ux-foundation.org, linux-kernel@...r.kernel.org,
mingo@...nel.org, hpa@...or.com, tglx@...utronix.de
Cc: linux-tip-commits@...r.kernel.org
Subject: Re: [tip:locking/core] locking/lockdep/selftests: Add mixed
read-write ABBA tests
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@...radead.org>
> AuthorDate: Wed, 23 Aug 2017 13:13:11 +0200
> Committer: Ingo Molnar <mingo@...nel.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);
Powered by blists - more mailing lists