kernel_samsung_a53x/kernel/sched
Josh Don bb74b7f456 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
2024-12-18 12:21:46 +01:00
..
ems kernel: sched: ems: drop usage of SCHED_FEAT 2024-11-19 17:52:14 +01:00
autogroup.c sched/fair: Prevent dead task groups from regaining cfs_rq's 2024-12-18 12:21:30 +01:00
autogroup.h
clock.c
completion.c sched/completion: Expose wait_for_common*() to drivers 2024-11-17 17:45:08 +01:00
core.c sched/fair: Prevent dead task groups from regaining cfs_rq's 2024-12-18 12:21:30 +01:00
cpuacct.c
cpudeadline.c
cpudeadline.h
cpufreq.c
cpufreq_schedutil.c schedutil: Allow CPU frequency changes to be amended before they're set 2024-11-19 18:06:02 +01:00
cpupri.c
cpupri.h
cputime.c sched/cputime: Fix mul_u64_u64_div_u64() precision for cputime 2024-11-23 23:20:24 +01:00
deadline.c
debug.c
fair.c sched: Allow newidle balancing to bail out of load_balance 2024-12-18 12:21:46 +01:00
features.h Revert "fs,kernel,mm: tune to Ktweak balance" 2024-12-17 20:58:55 +01:00
idle.c sched/fair: Trigger the update of blocked load on newly idle cpu 2024-12-17 13:24:33 +01:00
isolation.c
loadavg.c
Makefile
membarrier.c sched/membarrier: reduce the ability to hammer on sys_membarrier 2024-11-18 12:13:39 +01:00
pelt.c kernel: sched: Provide more PELT half-life options 2024-11-17 17:41:17 +01:00
pelt.h
psi.c
rt.c sched/fair: Prevent dead task groups from regaining cfs_rq's 2024-12-18 12:21:30 +01:00
sched-pelt.h kernel: sched: Provide more PELT half-life options 2024-11-17 17:41:17 +01:00
sched.h sched/fair: Prevent dead task groups from regaining cfs_rq's 2024-12-18 12:21:30 +01:00
sec_mpam.c
sec_mpam_cpbm.h
sec_mpam_sysfs.c
sec_mpam_sysfs.h
smp.h
stats.c
stats.h
stop_task.c
swait.c
topology.c sched/fair: Wait before decaying max_newidle_lb_cost 2024-12-18 12:21:16 +01:00
wait.c
wait_bit.c