[RFC PATCH v3 7/7] futex: use hq-spinlock for hash buckets
From: Fedorov Nikita
Date: Wed Apr 15 2026 - 12:48:57 EST
Example of hq-spinlock enabled for futex hash-table bucket locks
(used in memcached testing scenario)
In the evaluated memcached workloads, this improved throughput by up to
10% on AMD EPYC 9654 and by up to 8% on Kunpeng 920, with corresponding
latency reductions.
Co-developed-by: Anatoly Stepanov <stepanov.anatoly@xxxxxxxxxx>
Signed-off-by: Anatoly Stepanov <stepanov.anatoly@xxxxxxxxxx>
Co-developed-by: Nikita Fedorov <fedorov.nikita@xxxxxxxxxxxxxx>
Signed-off-by: Nikita Fedorov <fedorov.nikita@xxxxxxxxxxxxxx>
---
kernel/futex/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/futex/core.c b/kernel/futex/core.c
index 31e83a0978..042cdc7f75 100644
--- a/kernel/futex/core.c
+++ b/kernel/futex/core.c
@@ -1521,7 +1521,7 @@ static void futex_hash_bucket_init(struct futex_hash_bucket *fhb,
#endif
atomic_set(&fhb->waiters, 0);
plist_head_init(&fhb->chain);
- spin_lock_init(&fhb->lock);
+ spin_lock_init_hq(&fhb->lock);
}
#define FH_CUSTOM 0x01
--
2.34.1