]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: tasks: do not keep cpu and latency times in struct task
authorWilly Tarreau <w@1wt.eu>
Wed, 7 Sep 2022 07:17:45 +0000 (09:17 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 8 Sep 2022 12:19:15 +0000 (14:19 +0200)
commit6a28a30efaa8d6f6355cc4b1e9c8b5aeded661e4
treea4877cff9b7aea9a98a58f9b084259704aafdf54
parentbeee600491c15861a923113ee322c9f57aba07e5
MINOR: tasks: do not keep cpu and latency times in struct task

It was a mistake to put these two fields in the struct task. This
was added in 1.9 via commit 9efd7456e ("MEDIUM: tasks: collect per-task
CPU time and latency"). These fields are used solely by streams in
order to report the measurements via the lat_ns* and cpu_ns* sample
fetch functions when task profiling is enabled. For the rest of the
tasks, this is pure CPU waste when profiling is enabled, and memory
waste 100% of the time, as the point where these latencies and usages
are measured is in the profiling array.

Let's move the fields to the stream instead, and have process_stream()
retrieve the relevant info from the thread's context.

The struct task is now back to 120 bytes, i.e. almost two cache lines,
with 32 bit still available.
include/haproxy/stream-t.h
include/haproxy/task-t.h
include/haproxy/task.h
src/sample.c
src/stream.c
src/task.c