Skip to content

sched: Cleanup and improve polling idle loops

Andy Lutomirski lkml 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 1 replyIn review
  2. v16 patches 10 repliesSuperseded

Changes in v2 from the cover letter

- Squashed the two idle loop rearrangement patches.
- Improved comments.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5cpuidle: Set polling in poll_idledrivers/cpuidle/driver.c+5 -20 replies
2/5sched,trace: Add a tracepoint for IPI-less remote wakeupsinclude/trace/events/sched.h kernel/sched/core.c+24 -00 replies
3/5sched,idle: Clear polling before descheduling the idle threadkernel/sched/idle.c+25 -11 reply
4/5sched,idle: Simplify wake_up_idle_cpukernel/sched/core.c+1 -200 replies
5/5sched: Optimize ttwu IPIkernel/sched/core.c kernel/sched/idle.c kernel/sched/sched.h+61 -90 replies

Reviews trailers per patch

None of the 5 patches has a Reviewed-by or Acked-by.

PatchAndy Lutomirski
1/5
2/5
3/5
4/5
5/5Much-requested-by

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/5] sched: Cleanup and improve polling idle loops

This series reduces the number of IPIs on my workload by something like 99%. It's down from many hundreds per second to very few.

The basic idea behind this series is to make TIF_POLLING_NRFLAG be a reliable indication that the idle task is polling. Once that's done, the rest is reasonably straightforward.

Patches 1 and 2 are related improvements: patch 1 teaches the cpuidle polling loop how to poll, and patch 2 adds tracepoints so that avoided IPIs are visible. Patch 3 is the main semantic change, patch 4 is cleanup, and patch 5 is peterz's code, rebased on top of my stuff, and fixed up a bit.

Changes from v1:

- Squashed the two idle loop rearrangement patches.
- Improved comments.

Andy Lutomirski (4):
cpuidle: Set polling in poll_idle
sched,trace: Add a tracepoint for IPI-less remote wakeups sched,idle: Clear polling before descheduling the idle thread sched,idle: Simplify wake_up_idle_cpu

Peter Zijlstra (1):
sched: Optimize ttwu IPI

 drivers/cpuidle/driver.c     |  7 ++--
 include/trace/events/sched.h | 20 +++++++++++
 kernel/sched/core.c          | 79 +++++++++++++++++++++++++++++---------------
 kernel/sched/idle.c          | 30 ++++++++++++++++-
 kernel/sched/sched.h         |  6 ++++
 5 files changed, 113 insertions(+), 29 deletions(-)
Signature · 1 line
1.9.3