]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: task: always reset a new tasklet's call date
authorWilly Tarreau <w@1wt.eu>
Tue, 6 Sep 2022 17:06:52 +0000 (19:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 8 Sep 2022 12:19:15 +0000 (14:19 +0200)
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

index 3806428db8ddb560819593789ba84ff0cc9ad181..f2ff7e7cbe1a4df305a3cec9dccc6c6e2e2c10b9 100644 (file)
@@ -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);