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.
This commit is contained in:
Willy Tarreau 2022-09-06 19:06:52 +02:00
parent 3122c75fd1
commit f27acd961e

View 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);