From: Gurucharan Shetty Date: Sun, 28 Apr 2013 02:58:12 +0000 (-0700) Subject: vswitchd: Disable system stats collection on a concurrently running daemon. X-Git-Tag: v1.11.0~135 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=9f27568d9f6615b486bd13324b9a607864ef8780;p=cascardo%2Fovs.git vswitchd: Disable system stats collection on a concurrently running daemon. There are very rare cases (ex: ovs-vswitchd.pid is inadvertantly deleted), when multiple ovs-vswitchd daemons can end up running at the same time. In a situation like that one of the daemons can wait on the poll() with a 0 ms wait time as it would be expecting system stats to be collected. But system stats are never run for the daemon that does not have the lock on the database and hence it takes up 100% of the CPU if its state machine for stats collection previously was S_WAITING. With this patch, we disable the system stats collection for the daemon that does not have the database lock. When it eventually gets the lock on the database, system stats are automatically enabled if other_config:\ enable-statistics=true. Bug #16669. Signed-off-by: Gurucharan Shetty --- diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 19a8f48d7..eb1ab3c4b 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -2280,6 +2280,10 @@ bridge_run(void) HMAP_FOR_EACH_SAFE (br, next_br, node, &all_bridges) { bridge_destroy(br); } + /* Since we will not be running system_stats_run() in this process + * with the current situation of multiple ovs-vswitchd daemons, + * disable system stats collection. */ + system_stats_enable(false); return; } else if (!ovsdb_idl_has_lock(idl)) { return;