Skip to contentSkip to conversation

locking/qspinlock: Clarify pending field layout

PATCH Applied WEI-HONG, YE 3 participants 3 messages May 25 – Jun 3 Generic include/asm header files

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 locking/qspinlock: Clarify pending field layout

For CONFIG_NR_CPUS < 16K, _Q_PENDING_BITS is 8 and the pending field occupies bits 8-15 of the lock word. The current comment documents bit 8 as pending and bits 9-15 as unused, which describes the pending flag value rather than the field layout.

Describe bits 8-15 as the pending byte so the layout description is consistent with the lock byte.

---
 include/asm-generic/qspinlock_types.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
include/asm-generic/qspinlock_types.h +1 -2
index 2fd1fb89ec36..7d17b9bb069c 100644
@@ -53,8 +53,7 @@ typedef struct qspinlock {
  *
  * When NR_CPUS < 16K
  *  0- 7: locked byte
- *     8: pending
- *  9-15: not used
+ *  8-15: pending byte
  * 16-17: tail index
  * 18-31: tail cpu (+1)
  *
Signature · 1 line
2.48.1
Acked-by on v1 1/1
#1 lore raw
Quoted 18 lines · YE

For CONFIG_NR_CPUS < 16K, _Q_PENDING_BITS is 8 and the pending field occupies bits 8-15 of the lock word. The current comment documents bit 8 as pending and bits 9-15 as unused, which describes the pending flag value rather than the field layout.

Describe bits 8-15 as the pending byte so the layout description is consistent with the lock byte.

---
  include/asm-generic/qspinlock_types.h | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
include/asm-generic/qspinlock_types.h +0 -0
index 2fd1fb89ec36..7d17b9bb069c 100644

include/asm-generic/qspinlock_types.h typedef struct qspinlock { · line 59

Quoted 9 lines
include/asm-generic/qspinlock_types.h +1 -2
@@ -53,8 +53,7 @@ typedef struct qspinlock {
   *
   * When NR_CPUS < 16K
   *  0- 7: locked byte
- *     8: pending
- *  9-15: not used
+ *  8-15: pending byte
   * 16-17: tail index
   * 18-31: tail cpu (+1)
   *

Yes, we forgot to update the comment accordingly.

merge bot Applied
#2 lore raw
In reply to WEI-HONG, YE
The following commit has been merged into the locking/core branch of tip:

The following commit has been merged into the locking/core branch of tip:

Commit-ID:     cb19b8a9add2ed3774c1276e0a3906e52e8cf39a
Gitweb:        https://git.kernel.org/tip/cb19b8a9add2ed3774c1276e0a3906e52e8cf39a
Author:        WEI-HONG, YE <[email protected]>
AuthorDate:    Mon, 25 May 2026 13:04:50 
Committer:     Peter Zijlstra <[email protected]>
CommitterDate: Wed, 03 Jun 2026 11:38:46 +02:00

locking/qspinlock: Clarify pending field layout

For CONFIG_NR_CPUS < 16K, _Q_PENDING_BITS is 8 and the pending field occupies bits 8-15 of the lock word. The current comment documents bit 8 as pending and bits 9-15 as unused, which describes the pending flag value rather than the field layout.

Describe bits 8-15 as the pending byte so the layout description is consistent with the lock byte.

---
 include/asm-generic/qspinlock_types.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
include/asm-generic/qspinlock_types.h +1 -2
index 2fd1fb8..7d17b9b 100644
@@ -53,8 +53,7 @@ typedef struct qspinlock {
  *
  * When NR_CPUS < 16K
  *  0- 7: locked byte
- *     8: pending
- *  9-15: not used
+ *  8-15: pending byte
  * 16-17: tail index
  * 18-31: tail cpu (+1)
  *