From: Olivier Houchard Date: Mon, 24 Dec 2018 13:03:10 +0000 (+0100) Subject: BUG/MEDIUM: tasks: Decrement tasks_run_queue in tasklet_free(). X-Git-Tag: v2.0-dev1~317 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=09e498f1a1720dfc29c6c443a038517251364920;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/include/proto/task.h b/include/proto/task.h index a1aa0ffb80..bd2fe4cbb6 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);