MINOR: task: perform atomic counter increments only once per wakeup
authorWilly Tarreau <w@1wt.eu>
Mon, 30 Nov 2020 14:39:00 +0000 (15:39 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 30 Nov 2020 17:17:44 +0000 (18:17 +0100)
commitc309dbdd9932f7ecd8976e8f0a2479b65149eb76
treee01c8269641824b69d4037b8e75038eb42ab7721
parenta868c2920bf1f85858bf389ab182ef2f07d33e1b
MINOR: task: perform atomic counter increments only once per wakeup

In process_runnable_tasks(), we walk the run queue and pick tasks to
insert them into the local list. And for each of these operations we
perform a few increments, some of which are atomic, and they're even
performed under the runqueue's lock. This is useless inside the loop,
better do them at the end, since we don't use these values inside the
loop and they're not used anywhere else either during this time. The
only one is task_list_size which is accessed in parallel by other
threads performing remote tasklet wakeups, but it's already
approximative and is used to decide to get out of the loop when the
limit is reached. So now we compute it first as an initial budget
instead.
src/task.c