From 3f48bc39fb128e2cda57920b86082719d3b8d004 Mon Sep 17 00:00:00 2001 From: "Emilio G. Cota" Date: Wed, 1 Jul 2015 17:55:59 -0400 Subject: [PATCH] ck_sequence: relax sequence increment from atomic to regular store The atomicity of the sequence number's increment is unnecessary, since there should be only one writer at any given time. Fix it by changing it for a regular increment + store. Signed-off-by: Emilio G. Cota --- include/ck_sequence.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/ck_sequence.h b/include/ck_sequence.h index 46ceb3b..2aa0184 100644 --- a/include/ck_sequence.h +++ b/include/ck_sequence.h @@ -101,7 +101,7 @@ ck_sequence_write_begin(struct ck_sequence *sq) * Increment the sequence to an odd number to indicate * the beginning of a write update. */ - ck_pr_inc_uint(&sq->sequence); + ck_pr_store_uint(&sq->sequence, sq->sequence + 1); ck_pr_fence_store(); return; } @@ -118,7 +118,7 @@ ck_sequence_write_end(struct ck_sequence *sq) * completion of a write update. */ ck_pr_fence_store(); - ck_pr_inc_uint(&sq->sequence); + ck_pr_store_uint(&sq->sequence, sq->sequence + 1); return; }