]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: task: move the cpu_time field to the task-only part
authorWilly Tarreau <w@1wt.eu>
Thu, 8 Aug 2019 08:09:08 +0000 (10:09 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 8 Aug 2019 08:11:05 +0000 (10:11 +0200)
The CPU time accounting field called "cpu_time" is used only by tasks
and not tasklets, yet it used to be stored into the TASK_COMMON part,
which doesn't make sense and wastes tasklet memory. In addition, moving
it to tasks also helps better group the various parts in cache lines.

include/types/task.h

index a94905893998b1099d7259e9aa7285736b88ac51..3421cd3bd9d55711ea878664f20b7cee92a11a41 100644 (file)
@@ -75,7 +75,6 @@ struct task_per_thread {
                unsigned short state; /* task state : bitfield of TASK_ */ \
                short nice; /* task prio from -1024 to +1024, or -32768 for tasklets */ \
                unsigned int calls; /* number of times process was called */ \
-               uint64_t cpu_time; /* total CPU time consumed */            \
                struct task *(*process)(struct task *t, void *ctx, unsigned short state); /* the function which processes the task */ \
                void *context; /* the task's context */                 \
        }
@@ -89,6 +88,7 @@ struct task {
        unsigned long thread_mask;      /* mask of thread IDs authorized to process the task */
        uint64_t call_date;             /* date of the last task wakeup or call */
        uint64_t lat_time;              /* total latency time experienced */
+       uint64_t cpu_time;              /* total CPU time consumed */
 };
 
 /* lightweight tasks, without priority, mainly used for I/Os */