]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
fixup! IO: Allow to take new loops if the thread is hot, but only one at time
authorMaria Matejka <mq@ucw.cz>
Thu, 27 Jun 2024 12:25:06 +0000 (14:25 +0200)
committerMaria Matejka <mq@ucw.cz>
Thu, 27 Jun 2024 12:25:06 +0000 (14:25 +0200)
sysdep/unix/io-loop.c

index a29a922ffe4bd642074fef23f272f96ee41d0b87..0a362ce1db6a0213a710ba7fd23cd21889caae57 100644 (file)
@@ -706,7 +706,7 @@ birdloop_take(struct birdloop_pickup_group *group)
        birdloop_set_thread(loop, NULL, group);
 
        dropped++;
-       if (dropped * dropped > this_thread->loop_count)
+       if ((dropped * dropped) / 2 > this_thread->loop_count)
        {
          birdloop_leave(loop);
 
@@ -764,10 +764,12 @@ birdloop_take(struct birdloop_pickup_group *group)
     }
 
     bird_thread_pickup_next(group);
+
+    if (assign)
+      this_thread->meta->last_transition_ns = ns_now();
   }
 
   UNLOCK_DOMAIN(attrs, group->domain);
-  this_thread->meta->last_transition_ns = ns_now();
 }
 
 static int