]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Never allow more than 300 ms per loop
authorMaria Matejka <mq@ucw.cz>
Fri, 31 May 2024 19:22:07 +0000 (21:22 +0200)
committerMaria Matejka <mq@ucw.cz>
Tue, 4 Jun 2024 08:11:36 +0000 (10:11 +0200)
sysdep/unix/io-loop.c

index d36cbcc68e158420b2f37da74c922d24ca67c739..96b67e22a9512044309d85247df0dfd80a2b2a2d 100644 (file)
@@ -817,7 +817,11 @@ bird_thread_main(void *arg)
     /* Compute maximal time per loop */
     u64 thr_before_run = ns_now();
     if (thr->loop_count > 0)
+    {
       thr->max_loop_time_ns = (thr->max_latency_ns / 2 - (thr_before_run - thr_loop_start)) / (u64) thr->loop_count;
+      if (thr->max_loop_time_ns > 300 MS)
+       thr->max_loop_time_ns = 300 MS;
+    }
 
     /* Run all scheduled loops */
     int more_events = ev_run_list(&thr->meta->event_list);