]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[OPTIM] task: don't unlink a task from a wait queue when waking it up
authorWilly Tarreau <w@1wt.eu>
Sat, 7 Mar 2009 16:25:21 +0000 (17:25 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 8 Mar 2009 06:59:18 +0000 (07:59 +0100)
commit4726f53794be62ecbf27c57a785cc14cb2b226e3
treee695ad2f3edd5ebd0082045b177dd13b044ec60b
parent1b8ca663a46a1927affcbb0a4fcca9272860a3a7
[OPTIM] task: don't unlink a task from a wait queue when waking it up

In many situations, we wake a task on an I/O event, then queue it
exactly where it was. This is a real waste because we delete/insert
tasks into the wait queue for nothing. The only reason for this is
that there was only one tree node in the task struct.

By adding another tree node, we can have one tree for the timers
(wait queue) and one tree for the priority (run queue). That way,
we can have a task both in the run queue and wait queue at the
same time. The wait queue now really holds timers, which is what
it was designed for.

The net gain is at least 1 delete/insert cycle per session, and up
to 2-3 depending on the workload, since we save one cycle each time
the expiration date is not changed during a wake up.
include/proto/task.h
include/types/task.h
src/dumpstats.c
src/task.c