Any VLOG statement including debug ones in OVS will always invoke vlog_valist() https://github.com/openvswitch/ovs/blob/master/lib/vlog.c#L1093 This function will ALWAYS lock the logging file mutex at entry regardless of the fact if it: 1. Need to log at all 2. Is logging to file It is trivial to modify it so that it fast-paths across the "need to log" criteria and mutex-locks only if it is actually supposed to log. This is invoked from > 2000 places including locations which are in performance critical/time critical sections. In addition to being a performance issue, this is also an issue when trying to improve performance by splitting work between threads because it makes the codebase highly Heisenbuggy - multithreaded code works with debug on for a particular module and stops working without it.
Fix submitted upstream.
Fix is upstream, we may consider backporting it.
http://patchwork.ozlabs.org/project/openvswitch/patch/20200421082438.15037-1-anton.ivanov@cambridgegreys.com/ Fixed in OVS 2.14 and later.