From: Victor Julien Date: Wed, 3 Feb 2021 11:00:51 +0000 (+0100) Subject: flow/manager: (u)sleep slightly longer X-Git-Tag: suricata-7.0.0-beta1~1825 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17a38f1823adeb9eb059f666686e35509f3a13d2;p=thirdparty%2Fsuricata.git flow/manager: (u)sleep slightly longer Sleep 250 microseconds instead of 100 as running in KVM cause the old value to use 100% CPU for these threads. Perf testing suggests no measurable impact for the non-KVM case. Ticket: #4096 --- diff --git a/src/flow-manager.c b/src/flow-manager.c index cb430ec74d..d58a49637d 100644 --- a/src/flow-manager.c +++ b/src/flow-manager.c @@ -1011,7 +1011,7 @@ static TmEcode FlowManager(ThreadVars *th_v, void *thread_data) memset(&sleep_startts, 0, sizeof(sleep_startts)); gettimeofday(&sleep_startts, NULL); #endif - usleep(100); + usleep(250); #ifdef FM_PROFILE struct timeval sleep_endts; @@ -1207,7 +1207,7 @@ static TmEcode FlowRecycler(ThreadVars *th_v, void *thread_data) memset(&sleep_startts, 0, sizeof(sleep_startts)); gettimeofday(&sleep_startts, NULL); #endif - usleep(100); + usleep(250); #ifdef FM_PROFILE struct timeval sleep_endts; memset(&sleep_endts, 0, sizeof(sleep_endts));