From f27acd961e9b4291f80bc54100e57969ec4372ec Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 6 Sep 2022 19:06:52 +0200 Subject: [PATCH] BUG/MINOR: task: always reset a new tasklet's call date The tasklet's call date was not reset, so if profiling was enabled while some tasklets were in the run queue, their initial random value could be used to preload a bogus initial latency value into the task profiling bin. Let's just zero the initial value. This should be backported to 2.4 as it was brought with initial commit b2285de04 ("MINOR: tasks: also compute the tasklet latency when DEBUG_TASK is set"). The impact is very low though. --- include/haproxy/task.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/haproxy/task.h b/include/haproxy/task.h index 3806428db..f2ff7e7cb 100644 --- a/include/haproxy/task.h +++ b/include/haproxy/task.h @@ -519,6 +519,7 @@ static inline void tasklet_init(struct tasklet *t) t->process = NULL; t->tid = -1; #ifdef DEBUG_TASK + t->call_date = 0; t->debug.caller_idx = 0; #endif LIST_INIT(&t->list);