]> git.ipfire.org Git - thirdparty/haproxy.git/commit
CLEANUP: sched: remove duplicate code in run_tasks_from_list()
authorWilly Tarreau <w@1wt.eu>
Wed, 7 Sep 2022 15:06:16 +0000 (17:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 8 Sep 2022 12:30:38 +0000 (14:30 +0200)
commita9a2384612a6e57d81fcccdafbc68f1e31734a93
treea156934f07b09e5dedaca4ab68cb17bc577afd8b
parente0e6d81460e2458c092146d31335cc1d76fe824f
CLEANUP: sched: remove duplicate code in run_tasks_from_list()

Now that ->wake_date is common to tasks and tasklets, we don't need
anymore to carry a duplicate control block to read and update it for
tasks and tasklets. And given that this code was present early in the
if/else fork between tasks and tasklets, taking it out of the block
allows to move the task part into a more visible "else" branch that
also allows to factor the epilogue that resets th_ctx->current and
updates profile_entry->cpu_time, which also used to be duplicated.

Overall, doing just that saved 253 bytes in the function, or ~1/6,
which is not bad considering that it's on a hot path. And the code
got much ore readable.
src/task.c