From: Willy Tarreau Date: Wed, 6 Mar 2019 18:34:25 +0000 (+0100) Subject: MINOR: task: use LIST_DEL_INIT() to remove a task from the queue X-Git-Tag: v2.0-dev2~114 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b238b12e98f402e4bb042d9fda639b891da595a3;p=thirdparty%2Fhaproxy.git MINOR: task: use LIST_DEL_INIT() to remove a task from the queue 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. --- diff --git a/include/proto/task.h b/include/proto/task.h index eddbf92538..c90a369827 100644 --- a/include/proto/task.h +++ b/include/proto/task.h @@ -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)) {