Hi, all

In my test scenario, I found that it takes too long time, 488s, to create 512 
bridges in ovs 2.5.0.
After analyzing the code and some tests, I found that more than 70% of the time 
was consumed in the implementation of function xlate_txn_commit.
Function type_run calls xlate_txn_start and xlate_txn_commit(calls 
ovsrcu_synchronize) to implement RCU locking in each cycle of the loop.
Function ovsrcu_synchronize() was called too much times if there are certain 
number bridges, which means a lot of time waste.

So, I was thinking if I can use ovsrcu_postpone replacing ovsrcu_synchronize to 
shorten the execution time of type_run when there are certain number bridges.
I have tested this, and the result indicates that the time of creating 512 
bridges will be short down to 269s. Result and my patch is as follows:


ovsrcu_postpone

ovsrcu_synchronize

ovs

269

488



This is my patch:
ofproto/ofproto-dpif-xlate.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index d5f18b6..59f4b5c 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -865,8 +865,9 @@ xlate_txn_commit(void)
     struct xlate_cfg *xcfg = ovsrcu_get(struct xlate_cfg *, &xcfgp);
     ovsrcu_set(&xcfgp, new_xcfg);
-    ovsrcu_synchronize();
-    xlate_xcfg_free(xcfg);
+    ovsrcu_postpone(xlate_xcfg_free, xcfg);
     new_xcfg = NULL;
}

Whether this modification will introduce any problems?

Any reply will be appreciated! Thanks for all the attention!

B.R.
Sha Zhang
_______________________________________________
discuss mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss

Reply via email to