From: Waiman Long <Waiman.Long@hp.com>
To: Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Maarten Lankhorst <maarten.lankhorst@canonical.com>,
Rik van Riel <riel@redhat.com>
Cc: linux-kernel@vger.kernel.org,
Scott J Norton <scott.norton@hp.com>,
Fengguang Wu <fengguang.wu@intel.com>,
Waiman Long <Waiman.Long@hp.com>,
Peter Zijlstra <peterz@infradead.org>
Subject: [PATCH 2/2 v6] locking/selftest: Support queued rwlock
Date: Tue, 29 Jul 2014 14:53:19 -0400 [thread overview]
Message-ID: <1406659999-13974-3-git-send-email-Waiman.Long@hp.com> (raw)
In-Reply-To: <1406659999-13974-1-git-send-email-Waiman.Long@hp.com>
The queued rwlock does not support the use of recursive read-lock in
the process context. With changes in the lockdep code to check and
disallow recursive read-lock, it is also necessary for the locking
selftest to be updated to change the process context recursive read
locking results from SUCCESS to FAILURE for rwlock.
Signed-off-by: Waiman Long <Waiman.Long@hp.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
---
lib/locking-selftest.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/locking-selftest.c b/lib/locking-selftest.c
index 872a15a..9a33688 100644
--- a/lib/locking-selftest.c
+++ b/lib/locking-selftest.c
@@ -267,19 +267,19 @@ GENERATE_TESTCASE(AA_rsem)
#undef E
/*
- * Special-case for read-locking, they are
+ * Special-case for read-locking, they are not
* allowed to recurse on the same lock class:
*/
static void rlock_AA1(void)
{
RL(X1);
- RL(X1); // this one should NOT fail
+ RL(X1); // this one should fail
}
static void rlock_AA1B(void)
{
RL(X1);
- RL(X2); // this one should NOT fail
+ RL(X2); // this one should fail
}
static void rsem_AA1(void)
@@ -1069,7 +1069,7 @@ static inline void print_testname(const char *testname)
print_testname(desc); \
dotest(name##_spin, FAILURE, LOCKTYPE_SPIN); \
dotest(name##_wlock, FAILURE, LOCKTYPE_RWLOCK); \
- dotest(name##_rlock, SUCCESS, LOCKTYPE_RWLOCK); \
+ dotest(name##_rlock, FAILURE, LOCKTYPE_RWLOCK); \
dotest(name##_mutex, FAILURE, LOCKTYPE_MUTEX); \
dotest(name##_wsem, FAILURE, LOCKTYPE_RWSEM); \
dotest(name##_rsem, FAILURE, LOCKTYPE_RWSEM); \
@@ -1830,14 +1830,14 @@ void locking_selftest(void)
printk(" --------------------------------------------------------------------------\n");
print_testname("recursive read-lock");
printk(" |");
- dotest(rlock_AA1, SUCCESS, LOCKTYPE_RWLOCK);
+ dotest(rlock_AA1, FAILURE, LOCKTYPE_RWLOCK);
printk(" |");
dotest(rsem_AA1, FAILURE, LOCKTYPE_RWSEM);
printk("\n");
print_testname("recursive read-lock #2");
printk(" |");
- dotest(rlock_AA1B, SUCCESS, LOCKTYPE_RWLOCK);
+ dotest(rlock_AA1B, FAILURE, LOCKTYPE_RWLOCK);
printk(" |");
dotest(rsem_AA1B, FAILURE, LOCKTYPE_RWSEM);
printk("\n");
--
1.7.1
next prev parent reply other threads:[~2014-07-29 18:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-29 18:53 [PATCH 0/2 v6] lockdep: add support for " Waiman Long
2014-07-29 18:53 ` [PATCH 1/2 v6] locking/lockdep: Restrict the use of recursive read_lock() with qrwlock Waiman Long
2014-07-29 18:53 ` Waiman Long [this message]
2014-08-05 13:28 ` [PATCH 2/2 v6] locking/selftest: Support queued rwlock Peter Zijlstra
2014-08-05 14:07 ` Shuah Khan
2014-08-05 14:41 ` Peter Zijlstra
2014-08-05 14:44 ` Maarten Lankhorst
2014-08-05 14:54 ` Peter Zijlstra
2014-08-05 15:05 ` Shuah Khan
2014-08-05 15:25 ` Peter Zijlstra
2014-08-05 15:45 ` Shuah Khan
2014-08-06 17:24 ` Waiman Long
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=1406659999-13974-3-git-send-email-Waiman.Long@hp.com \
--to=waiman.long@hp.com \
--cc=fengguang.wu@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@canonical.com \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=riel@redhat.com \
--cc=scott.norton@hp.com \
/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
all inboxes | Powered by JetHome®