diff mbox series

[ovs-dev,v2,08/11] conntrack: Do not schedule zero ms timers

Message ID 9bd5cd93354d76d8ca19f1bfdc5db66e237d848d.1619041940.git.grive@u256.net
State Superseded
Headers show
Series conntrack: improve multithread scalability | expand

Commit Message

Gaetan Rivet April 21, 2021, 10:11 p.m. UTC
When ct_sweep() is far behind on its work, the 'next_wake' returned can
be before the moment it started. When it happens, the thread schedules a
zero ms timer that is logged as an error.

Instead, mark the thread for immediate wake in the next poll_block().

Signed-off-by: Gaetan Rivet <grive@u256.net>
Reviewed-by: Eli Britstein <elibr@nvidia.com>
---
 lib/conntrack.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/lib/conntrack.c b/lib/conntrack.c
index 16ed8de15..ea2e5b63b 100644
--- a/lib/conntrack.c
+++ b/lib/conntrack.c
@@ -1706,6 +1706,8 @@  clean_thread_main(void *f_)
         next_wake = conntrack_clean(ct, now);
 
         if (next_wake < now) {
+            poll_immediate_wake();
+        } else if (next_wake < now + CT_CLEAN_MIN_INTERVAL) {
             poll_timer_wait_until(now + CT_CLEAN_MIN_INTERVAL);
         } else {
             poll_timer_wait_until(MAX(next_wake, now + CT_CLEAN_INTERVAL));