diff options
author | Josh Don <joshdon@google.com> | 2022-06-09 05:55:15 +0300 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2022-06-13 11:30:01 +0300 |
commit | 792b9f65a568f48c50b3175536db9cde5a1edcc0 (patch) | |
tree | 293519728cff7baa4abe70544f3143473e8b667c /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 2ed81e765417ec2526f901366167a13294ef09ce (diff) | |
download | linux-792b9f65a568f48c50b3175536db9cde5a1edcc0.tar.xz |
sched: Allow newidle balancing to bail out of load_balance
While doing newidle load balancing, it is possible for new tasks to
arrive, such as with pending wakeups. newidle_balance() already accounts
for this by exiting the sched_domain load_balance() iteration if it
detects these cases. This is very important for minimizing wakeup
latency.
However, if we are already in load_balance(), we may stay there for a
while before returning back to newidle_balance(). This is most
exacerbated if we enter a 'goto redo' loop in the LBF_ALL_PINNED case. A
very straightforward workaround to this is to adjust should_we_balance()
to bail out if we're doing a CPU_NEWLY_IDLE balance and new tasks are
detected.
This was tested with the following reproduction:
- two threads that take turns sleeping and waking each other up are
affined to two cores
- a large number of threads with 100% utilization are pinned to all
other cores
Without this patch, wakeup latency was ~120us for the pair of threads,
almost entirely spent in load_balance(). With this patch, wakeup latency
is ~6us.
Signed-off-by: Josh Don <joshdon@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20220609025515.2086253-1-joshdon@google.com
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions