From 2bf28e790ec9b89f71d25293c01ff26d7f097e1e Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Thu, 27 Jun 2024 08:26:00 +0200 Subject: [PATCH] IO: Allow to take new loops if the thread is hot, but only one at time --- sysdep/unix/io-loop.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sysdep/unix/io-loop.c b/sysdep/unix/io-loop.c index 32530826..07462b6d 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));