From: Willy Tarreau Date: Tue, 6 Sep 2022 17:06:52 +0000 (+0200) Subject: BUG/MINOR: task: always reset a new tasklet's call date X-Git-Tag: v2.7-dev6~91 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f27acd961e9b4291f80bc54100e57969ec4372ec;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/include/haproxy/task.h b/include/haproxy/task.h index 3806428db8..f2ff7e7cbe 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);