[RFC PATCH v2 4/5] lockref: use hq-spinlock

From: Anatoly Stepanov

Date: Fri Dec 05 2025 - 17:57:57 EST


- Example of HQ-spinlock enabled for dentry->lockref spinlock
(used in Nginx testing scenario)

Signed-off-by: Anatoly Stepanov <stepanov.anatoly@xxxxxxxxxx>

Co-authored-by: Stepanov Anatoly <stepanov.anatoly@xxxxxxxxxx>
Co-authored-by: Fedorov Nikita <fedorov.nikita@xxxxxxxxxxxxxx>
---
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 676721ee8..294686604 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