From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 6/6] kernel/locking: Remove unused union members from struct qrwlock
Date: Thu, 5 Oct 2017 13:54:57 +0100 [thread overview]
Message-ID: <1507208097-825-7-git-send-email-will.deacon@arm.com> (raw)
In-Reply-To: <1507208097-825-1-git-send-email-will.deacon@arm.com>
Now that all atomic operations are performed on the full lock word of
the qrwlock, there's no need to define a union type exposing the reader
and writer subcomponents. Remove them.
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Waiman Long <longman@redhat.com>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
include/asm-generic/qrwlock_types.h | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/include/asm-generic/qrwlock_types.h b/include/asm-generic/qrwlock_types.h
index 507f2dc51bba..7f53be31359c 100644
--- a/include/asm-generic/qrwlock_types.h
+++ b/include/asm-generic/qrwlock_types.h
@@ -9,23 +9,12 @@
*/
typedef struct qrwlock {
- union {
- atomic_t cnts;
- struct {
-#ifdef __LITTLE_ENDIAN
- u8 wmode; /* Writer mode */
- u8 rcnts[3]; /* Reader counts */
-#else
- u8 rcnts[3]; /* Reader counts */
- u8 wmode; /* Writer mode */
-#endif
- };
- };
+ atomic_t cnts;
arch_spinlock_t wait_lock;
} arch_rwlock_t;
#define __ARCH_RW_LOCK_UNLOCKED { \
- { .cnts = ATOMIC_INIT(0), }, \
+ .cnts = ATOMIC_INIT(0), \
.wait_lock = __ARCH_SPIN_LOCK_UNLOCKED, \
}
--
2.1.4
next prev parent reply other threads:[~2017-10-05 12:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-05 12:54 [PATCH 0/6] Switch arm64 over to qrwlock Will Deacon
2017-10-05 12:54 ` [PATCH 1/6] kernel/locking: Use struct qrwlock instead of struct __qrwlock Will Deacon
2017-10-05 12:54 ` [PATCH 2/6] locking/atomic: Add atomic_cond_read_acquire Will Deacon
2017-10-05 12:54 ` [PATCH 3/6] kernel/locking: Use atomic_cond_read_acquire when spinning in qrwlock Will Deacon
2017-10-05 12:54 ` [PATCH 4/6] arm64: locking: Move rwlock implementation over to qrwlocks Will Deacon
2017-10-05 12:54 ` [PATCH 5/6] kernel/locking: Prevent slowpath writers getting held up by fastpath Will Deacon
2017-10-05 13:56 ` Peter Zijlstra
2017-10-05 14:37 ` Waiman Long
2017-10-05 14:42 ` Will Deacon
2017-10-05 12:54 ` Will Deacon [this message]
2017-10-05 22:12 ` [PATCH 0/6] Switch arm64 over to qrwlock Jeremy Linton
2017-10-06 8:39 ` Will Deacon
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=1507208097-825-7-git-send-email-will.deacon@arm.com \
--to=will.deacon@arm.com \
--cc=linux-arm-kernel@lists.infradead.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).