When calling ovsrcu_synchronize(), it always block 1000ms because we poll
block until elapsed time become greater than
warning_threshold(1000).That's too long for some configuration commands.
So this patch reduces warning_threshold's default value to 100 and print
logs after it have elapsed more than 1000ms.

Change-Id: Ib698afb47a600de00f52d8a5aa63039f0097514f
Signed-off-by: Lilijun <[email protected]>
---
 lib/ovs-rcu.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/ovs-rcu.c b/lib/ovs-rcu.c
index ebc8120..af52cc5 100644
--- a/lib/ovs-rcu.c
+++ b/lib/ovs-rcu.c
@@ -191,7 +191,7 @@ ovsrcu_is_quiescent(void)
 void
 ovsrcu_synchronize(void)
 {
-    unsigned int warning_threshold = 1000;
+    unsigned int warning_threshold = 100;
     uint64_t target_seqno;
     long long int start;
 
@@ -226,8 +226,10 @@ ovsrcu_synchronize(void)
 
         elapsed = time_msec() - start;
         if (elapsed >= warning_threshold) {
-            VLOG_WARN("blocked %u ms waiting for %s to quiesce",
-                      elapsed, stalled_thread);
+            if (warning_threshold >= 1000) {
+                VLOG_WARN("blocked %u ms waiting for %s to quiesce",
+                          elapsed, stalled_thread);
+            }
             warning_threshold *= 2;
         }
         poll_timer_wait_until(start + warning_threshold);
-- 
1.8.4.msysgit.0


_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to