]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: sched: do not requeue a tasklet into the current queue
authorWilly Tarreau <wtarreau@haproxy.com>
Sat, 21 Mar 2026 14:52:52 +0000 (14:52 +0000)
committerWilly Tarreau <w@1wt.eu>
Mon, 23 Mar 2026 05:54:42 +0000 (06:54 +0100)
As found by Christopher, the concept of waking a tasklet up into the
current queue is totally flawed, because if a task is in TL_BULK or
TL_HEAVY, all the tasklets it will wake up will end up in the same
queue. Not only this will clobber such queues, but it will also
reduce their quality of service, and this can contaminate other
tasklets due to the numerous wakeups there are now with the subsribe
mechanism between layers.

src/task.c

index 8f5523587d6ed62e7429e8f45ba65068d3aa7f85..08de79f4f97d007a90156a150bf28e0e4e3976ae 100644 (file)
@@ -157,8 +157,8 @@ void __tasklet_wakeup_on(struct tasklet *tl, int thr)
                        th_ctx->tl_class_mask |= 1 << TL_URGENT;
                }
                else {
-                       LIST_APPEND(&th_ctx->tasklets[th_ctx->current_queue], &tl->list);
-                       th_ctx->tl_class_mask |= 1 << th_ctx->current_queue;
+                       LIST_APPEND(&th_ctx->tasklets[TL_NORMAL], &tl->list);
+                       th_ctx->tl_class_mask |= 1 << TL_NORMAL;
                }
                _HA_ATOMIC_INC(&th_ctx->rq_total);
        } else {
@@ -196,8 +196,8 @@ struct list *__tasklet_wakeup_after(struct list *head, struct tasklet *tl)
                        th_ctx->tl_class_mask |= 1 << TL_URGENT;
                }
                else {
-                       LIST_INSERT(&th_ctx->tasklets[th_ctx->current_queue], &tl->list);
-                       th_ctx->tl_class_mask |= 1 << th_ctx->current_queue;
+                       LIST_INSERT(&th_ctx->tasklets[TL_NORMAL], &tl->list);
+                       th_ctx->tl_class_mask |= 1 << TL_NORMAL;
                }
        }
        else {