ovs-thread: Quiesce in xpthread_barrier_wait().
authorBen Pfaff <blp@nicira.com>
Fri, 25 Apr 2014 20:50:48 +0000 (13:50 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 28 Apr 2014 22:25:48 +0000 (15:25 -0700)
Otherwise the udpif revalidator threads can postpone RCU callbacks
essentially forever, especially if there are many revalidator threads and
little network traffic.

Reported-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
lib/ovs-thread.c

index 3ca686f..f33f5f1 100644 (file)
@@ -240,7 +240,10 @@ xpthread_barrier_wait(pthread_barrier_t *barrier)
 {
     int error;
 
 {
     int error;
 
+    ovsrcu_quiesce_start();
     error = pthread_barrier_wait(barrier);
     error = pthread_barrier_wait(barrier);
+    ovsrcu_quiesce_end();
+
     if (error && OVS_UNLIKELY(error != PTHREAD_BARRIER_SERIAL_THREAD)) {
         ovs_abort(error, "pthread_barrier_wait failed");
     }
     if (error && OVS_UNLIKELY(error != PTHREAD_BARRIER_SERIAL_THREAD)) {
         ovs_abort(error, "pthread_barrier_wait failed");
     }