[ovs-dev] [PATCH 17/18] lib/timeval: Use relaxed atomics also when writing on 'slow_path'.

Jarno Rajahalme jrajahalme at nicira.com
Fri Aug 22 20:58:28 UTC 2014


Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
---
 lib/timeval.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/timeval.c b/lib/timeval.c
index 66732b6..9d90f1b 100644
--- a/lib/timeval.c
+++ b/lib/timeval.c
@@ -147,7 +147,7 @@ time_timespec__(struct clock *c, struct timespec *ts)
 
     time_init();
 
-    atomic_read_explicit(&c->slow_path, &slow_path, memory_order_relaxed);
+    atomic_read_relaxed(&c->slow_path, &slow_path);
     if (!slow_path) {
         xclock_gettime(c->id, ts);
     } else {
@@ -682,7 +682,7 @@ timeval_stop_cb(struct unixctl_conn *conn,
                  void *aux OVS_UNUSED)
 {
     ovs_mutex_lock(&monotonic_clock.mutex);
-    atomic_store(&monotonic_clock.slow_path, true);
+    atomic_store_relaxed(&monotonic_clock.slow_path, true);
     monotonic_clock.stopped = true;
     xclock_gettime(monotonic_clock.id, &monotonic_clock.cache);
     ovs_mutex_unlock(&monotonic_clock.mutex);
@@ -717,7 +717,7 @@ timeval_warp_cb(struct unixctl_conn *conn,
         unixctl_command_reply_error(conn, "A previous warp in progress");
         return;
     }
-    atomic_store(&monotonic_clock.slow_path, true);
+    atomic_store_relaxed(&monotonic_clock.slow_path, true);
     monotonic_clock.large_warp.conn = conn;
     monotonic_clock.large_warp.total_warp = total_warp;
     monotonic_clock.large_warp.warp = msecs;
-- 
1.7.10.4




More information about the dev mailing list