Skip to content

newidle_balance() PREEMPT_RT latency mitigations

Scott Wood linux-rt-users lkml oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest3 patches 12 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3sched/fair: Call newidle_balance() from balance_callback on PREEMPT_RTkernel/sched/fair.c+30 -42 replies
2/3sched/fair: Enable interrupts when dropping lock in newidle_balance()kernel/sched/fair.c+8 -00 replies
3/3sched/fair: break out of newidle balancing if an RT task appearskernel/sched/fair.c kernel/sched/sched.h+26 -43 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/3] newidle_balance() PREEMPT_RT latency mitigations

These patches mitigate latency caused by newidle_balance() on large systems when PREEMPT_RT is enabled, by enabling interrupts when the lock is dropped, and exiting early at various points if an RT task is runnable on the current CPU.

On a system with 128 CPUs, these patches dropped latency (as measured by a 12 hour rteval run) from 1045us to 317us (when applied to 5.12.0-rc3-rt3).

I tried a couple scheduler benchmarks (perf bench sched pipe, and sysbench threads) to try to determine whether the overhead is measurable on non-RT, but the results varied widely enough (with or without the patches) that I couldn't draw any conclusions from them. So at least for now, I limited the balance callback change to when PREEMPT_RT is enabled.

Link to v1 RFC patches:
https://lore.kernel.org/lkml/[email protected]/

Scott Wood (3):
sched/fair: Call newidle_balance() from balance_callback on PREEMPT_RT sched/fair: Enable interrupts when dropping lock in newidle_balance() sched/fair: break out of newidle balancing if an RT task appears

 kernel/sched/fair.c  | 66 ++++++++++++++++++++++++++++++++++++++------
 kernel/sched/sched.h |  6 ++++
 2 files changed, 64 insertions(+), 8 deletions(-)
Signature · 1 line
2.27.0