From: Maria Matejka Date: Thu, 27 Jun 2024 12:25:06 +0000 (+0200) Subject: fixup! IO: Allow to take new loops if the thread is hot, but only one at time X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=825be301152c698f4ae77c8490c00c152a1e8a2b;p=thirdparty%2Fbird.git fixup! IO: Allow to take new loops if the thread is hot, but only one at time --- diff --git a/sysdep/unix/io-loop.c b/sysdep/unix/io-loop.c index a29a922ff..0a362ce1d 100644 --- a/sysdep/unix/io-loop.c +++ b/sysdep/unix/io-loop.c @@ -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