From 09e498f1a1720dfc29c6c443a038517251364920 Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Mon, 24 Dec 2018 14:03:10 +0100 Subject: [PATCH] BUG/MEDIUM: tasks: Decrement tasks_run_queue in tasklet_free(). If the tasklet is in the list, don't forget to decrement tasks_run_queue in tasklet_free(). This should be backported to 1.9. --- include/proto/task.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/proto/task.h b/include/proto/task.h index a1aa0ffb8..bd2fe4cbb 100644 --- a/include/proto/task.h +++ b/include/proto/task.h @@ -365,8 +365,10 @@ static inline void task_free(struct task *t) static inline void tasklet_free(struct tasklet *tl) { - if (!LIST_ISEMPTY(&tl->list)) + if (!LIST_ISEMPTY(&tl->list)) { task_per_thread[tid].task_list_size--; + HA_ATOMIC_SUB(&tasks_run_queue, 1); + } LIST_DEL(&tl->list); pool_free(pool_head_tasklet, tl);