]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MAJOR: sched: make it work also when not building with DEBUG_STRICT
authorWilly Tarreau <w@1wt.eu>
Thu, 2 Jul 2020 15:17:42 +0000 (17:17 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 2 Jul 2020 15:17:42 +0000 (17:17 +0200)
Sadly, the fix from commit 54d31170a ("BUG/MAJOR: sched: make sure
task_kill() always queues the task") broke the builds without DEBUG_STRICT
as, in order to be careful, it plcaed a BUG_ON() around the previously
failing condition to check for any new possible failure, but this BUG_ON
strips the condition when DEBUG_STRICT is not set. We don't want BUG_ON
to evaluate any condition either as some debugging code calls possibly
expensive ones (e.g. in htx_get_stline). Let's just drop the useless
BUG_ON().

No backport is needed, this is 2.2-dev.

src/task.c

index 7ce1cd2a37f88fd0b36b85be361fbd33bfa03949..72f09de30ddb4d9501a5cd4436d8cef35d831ac2 100644 (file)
@@ -97,8 +97,8 @@ void task_kill(struct task *t)
 
                        /* Beware: tasks that have never run don't have their ->list empty yet! */
                        LIST_INIT(&((struct tasklet *)t)->list);
-                       BUG_ON(!MT_LIST_ADDQ(&task_per_thread[thr].shared_tasklet_list,
-                                            (struct mt_list *)&((struct tasklet *)t)->list));
+                       MT_LIST_ADDQ(&task_per_thread[thr].shared_tasklet_list,
+                                    (struct mt_list *)&((struct tasklet *)t)->list);
                        _HA_ATOMIC_ADD(&tasks_run_queue, 1);
                        _HA_ATOMIC_ADD(&task_per_thread[thr].task_list_size, 1);
                        if (sleeping_thread_mask & (1UL << thr)) {