]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: task: use LIST_DEL_INIT() to remove a task from the queue
authorWilly Tarreau <w@1wt.eu>
Wed, 6 Mar 2019 18:34:25 +0000 (19:34 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 7 Mar 2019 10:45:44 +0000 (11:45 +0100)
By using LIST_DEL_INIT() instead of LIST_DEL()+LIST_INIT() we manage
to bump the peak connection rate by no less than 3% on 8 threads.
The perf top profile shows much less contention in this area which
suffered from the second reload.

include/proto/task.h

index eddbf92538d2b3865878b43e638d1efafc0b2674..c90a369827865e2b337d776b1096e9cd251abec6 100644 (file)
@@ -271,8 +271,7 @@ static inline void task_insert_into_tasklet_list(struct task *t)
 
 static inline void task_remove_from_task_list(struct task *t)
 {
-       LIST_DEL(&((struct tasklet *)t)->list);
-       LIST_INIT(&((struct tasklet *)t)->list);
+       LIST_DEL_INIT(&((struct tasklet *)t)->list);
        task_per_thread[tid].task_list_size--;
        HA_ATOMIC_SUB(&tasks_run_queue, 1);
        if (!TASK_IS_TASKLET(t)) {