]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: task: place the heavy elements in TL_HEAVY
authorWilly Tarreau <w@1wt.eu>
Fri, 26 Feb 2021 09:13:40 +0000 (10:13 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 26 Feb 2021 11:00:53 +0000 (12:00 +0100)
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.

src/task.c

index 1b1738defda3f8605d19e019a4f6436f46dbbafc..a64d1dfeb6e91aff1f2a9bed05aa53d84eb5d049 100644 (file)
@@ -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;
                }