[RFC PATCH v2 5/5] kernel: futex: use HQ-spinlock for hash-buckets

Anatoly Stepanov posted 5 patches 1 week, 6 days ago
[RFC PATCH v2 5/5] kernel: futex: use HQ-spinlock for hash-buckets
Posted by Anatoly Stepanov 1 week, 6 days ago
This is example of HQ-spinlock enabled for futex hash-table bucket locks
(used in memcached testing scenario)

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

Co-authored-by: Stepanov Anatoly <stepanov.anatoly@huawei.com>
Co-authored-by: Fedorov Nikita <fedorov.nikita@h-partners.com>
---
 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 125804fbb..05c6d1efc 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