]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: task: fix recently introduced scheduler skew
authorWilly Tarreau <w@1wt.eu>
Wed, 4 Mar 2015 22:26:01 +0000 (23:26 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 5 Mar 2015 10:49:17 +0000 (11:49 +0100)
Commit 501260b ("MEDIUM: task: always ensure that the run queue is
consistent") introduced a skew in the scheduler : if a negatively niced
task is woken up, it can be inserted prior to the current index and will
be skipped as long as there is some activity with less prioritary tasks.
The immediate effect is that it's not possible to get access to the stats
under full load until the load goes down.

This is because the rq_next constantly evolves within more recent
positions. The fix is simple, __task_wakeup() must empty rq_next. The
sad thing is that this issue was fixed during development and missed
during the commit. No backport is needed, this is purely 1.6 stuff.

src/task.c

index 4985aa22a96eab58c793607e1ef2f4df570b0fa6..d475322c4ca34ca28d661ef2d363f2bd76801662 100644 (file)
@@ -65,6 +65,7 @@ struct task *__task_wakeup(struct task *t)
        t->state &= ~TASK_WOKEN_ANY;
 
        eb32_insert(&rqueue, &t->rq);
+       rq_next = NULL;
        return t;
 }