From: Maria Matejka Date: Thu, 27 Jun 2024 06:26:00 +0000 (+0200) Subject: 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=2bf28e790ec9b89f71d25293c01ff26d7f097e1e;p=thirdparty%2Fbird.git 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 32530826c..07462b6d9 100644 --- a/sysdep/unix/io-loop.c +++ b/sysdep/unix/io-loop.c @@ -678,9 +678,6 @@ birdloop_take(struct birdloop_pickup_group *group) { struct birdloop *loop = NULL; - if (birdloop_hot_potato(this_thread->meta)) - return; - LOCK_DOMAIN(attrs, group->domain); if (this_thread->busy_active && @@ -743,7 +740,9 @@ birdloop_take(struct birdloop_pickup_group *group) if (group->thread_busy_count < group->thread_count) thread_count -= group->thread_busy_count; - uint assign = 1 + group->loop_unassigned_count / thread_count; + uint assign = birdloop_hot_potato(this_thread->meta) ? 1 : + 1 + group->loop_unassigned_count / thread_count; + for (uint i=0; !EMPTY_LIST(group->loops) && iloops));