[RFC PATCH v3 6/7] lockref: use hq-spinlock

Fedorov Nikita fedorov.nikita at h-partners.com
Wed Apr 15 09:44:58 PDT 2026


Example of hq-spinlock enabled for dentry->lockref spinlock
(used in nginx testing scenario)

In the evaluated nginx single-file workload on Kunpeng 920, throughput
gains reached 68-78% at 64-96 workers.

Co-developed-by: Anatoly Stepanov <stepanov.anatoly at huawei.com>
Signed-off-by: Anatoly Stepanov <stepanov.anatoly at huawei.com>
Co-developed-by: Nikita Fedorov <fedorov.nikita at h-partners.com>
Signed-off-by: Nikita Fedorov <fedorov.nikita at h-partners.com>
---
 include/linux/lockref.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/lockref.h b/include/linux/lockref.h
index 6ded24cdb4..19a1c3823c 100644
--- a/include/linux/lockref.h
+++ b/include/linux/lockref.h
@@ -42,7 +42,7 @@ struct lockref {
  */
 static inline void lockref_init(struct lockref *lockref)
 {
-	spin_lock_init(&lockref->lock);
+	spin_lock_init_hq(&lockref->lock);
 	lockref->count = 1;
 }
 
-- 
2.34.1




More information about the linux-arm-kernel mailing list