From 1d61147c01ab6ba4961fbc02a1a270b30f773f1a Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Sun, 19 Aug 2012 17:07:02 -0400 Subject: [PATCH] ck_spinlock/mcs: Remove unnecessary fences, serialize unload. --- include/ck_spinlock.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/ck_spinlock.h b/include/ck_spinlock.h index cac2210..c29ac4e 100644 --- a/include/ck_spinlock.h +++ b/include/ck_spinlock.h @@ -529,7 +529,6 @@ ck_spinlock_mcs_lock(struct ck_spinlock_mcs **queue, struct ck_spinlock_mcs *nod */ ck_pr_store_uint(&node->locked, true); ck_pr_store_ptr(&node->next, NULL); - ck_pr_fence_store(); /* * Swap current tail with current lock request. If the swap operation @@ -553,7 +552,6 @@ ck_spinlock_mcs_unlock(struct ck_spinlock_mcs **queue, struct ck_spinlock_mcs *n { struct ck_spinlock_mcs *next; - ck_pr_fence_load(); next = ck_pr_load_ptr(&node->next); if (next == NULL) { /* @@ -580,6 +578,7 @@ ck_spinlock_mcs_unlock(struct ck_spinlock_mcs **queue, struct ck_spinlock_mcs *n } /* Allow the next lock operation to complete. */ + ck_pr_fence_memory(); ck_pr_store_uint(&next->locked, false); return;