diff options
author | Florin Coras <fcoras@cisco.com> | 2021-06-02 11:17:29 -0700 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2021-06-03 17:17:43 +0000 |
commit | 324d161963025a595a79a10cf953b23250f825a1 (patch) | |
tree | c7846acba16958e085618f37707e49a58f0e4702 /src | |
parent | 821b5002bf5cd18e1ec7750ff1b6fb379b241869 (diff) |
svm: release mem order for fifo chunk list CAS
Type: fix
Signed-off-by: Florin Coras <fcoras@cisco.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: Ifad679f46abd6e9c18a3eaf7e55800a09f3791ab
Diffstat (limited to 'src')
-rw-r--r-- | src/svm/fifo_segment.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/svm/fifo_segment.c b/src/svm/fifo_segment.c index cb1f08a7e9f..b680d27fe33 100644 --- a/src/svm/fifo_segment.c +++ b/src/svm/fifo_segment.c @@ -161,8 +161,9 @@ fss_chunk_free_list_push (fifo_segment_header_t *fsh, c->next = old_head & FS_CL_HEAD_MASK; new_head = csp + ((old_head + FS_CL_HEAD_TINC) & FS_CL_HEAD_TMASK); } - while (!clib_atomic_cmp_and_swap_acq_relax ( - &fss->free_chunks[fl_index], &old_head, &new_head, 1 /* weak */)); + while (!__atomic_compare_exchange (&fss->free_chunks[fl_index], &old_head, + &new_head, 0 /* weak */, __ATOMIC_RELEASE, + __ATOMIC_ACQUIRE)); } static void @@ -181,8 +182,9 @@ fss_chunk_free_list_push_list (fifo_segment_header_t *fsh, tail->next = old_head & FS_CL_HEAD_MASK; new_head = headsp + ((old_head + FS_CL_HEAD_TINC) & FS_CL_HEAD_TMASK); } - while (!clib_atomic_cmp_and_swap_acq_relax ( - &fss->free_chunks[fl_index], &old_head, &new_head, 1 /* weak */)); + while (!__atomic_compare_exchange (&fss->free_chunks[fl_index], &old_head, + &new_head, 0 /* weak */, __ATOMIC_RELEASE, + __ATOMIC_ACQUIRE)); } static svm_fifo_chunk_t * @@ -210,8 +212,9 @@ fss_chunk_free_list_pop (fifo_segment_header_t *fsh, fifo_segment_slice_t *fss, c = fs_chunk_ptr (fsh, old_head & FS_CL_HEAD_MASK); new_head = c->next + ((old_head + FS_CL_HEAD_TINC) & FS_CL_HEAD_TMASK); } - while (!clib_atomic_cmp_and_swap_acq_relax ( - &fss->free_chunks[fl_index], &old_head, &new_head, 1 /* weak */)); + while (!__atomic_compare_exchange (&fss->free_chunks[fl_index], &old_head, + &new_head, 0 /* weak */, __ATOMIC_RELEASE, + __ATOMIC_ACQUIRE)); return c; } |