From: Willy Tarreau Date: Fri, 26 Feb 2021 09:13:40 +0000 (+0100) Subject: MINOR: task: place the heavy elements in TL_HEAVY X-Git-Tag: v2.4-dev10~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=826fa87246d2a8ae12525895f22655e7b9844682;p=thirdparty%2Fhaproxy.git MINOR: task: place the heavy elements in TL_HEAVY Instead of placing heavy tasklets into the TL_BULK queue, we now place them into the TL_HEAVY one, which is assigned a default weight of ~1% load at once. This way heavy tasks will not block TL_BULK anymore. --- diff --git a/src/task.c b/src/task.c index 1b1738defd..a64d1dfeb6 100644 --- a/src/task.c +++ b/src/task.c @@ -114,7 +114,11 @@ void __tasklet_wakeup_on(struct tasklet *tl, int thr) { if (likely(thr < 0)) { /* this tasklet runs on the caller thread */ - if (tl->state & (TASK_SELF_WAKING|TASK_HEAVY)) { + if (tl->state & TASK_HEAVY) { + LIST_ADDQ(&sched->tasklets[TL_HEAVY], &tl->list); + sched->tl_class_mask |= 1 << TL_HEAVY; + } + else if (tl->state & TASK_SELF_WAKING) { LIST_ADDQ(&sched->tasklets[TL_BULK], &tl->list); sched->tl_class_mask |= 1 << TL_BULK; }