Skip to content

cpuidle: Predict the next events with the IO latencies

Daniel Lezcano linux-pm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10sched: add io latency frameworkinclude/linux/sched.h init/Kconfig kernel/fork.c +4 more+246 -12 replies
2/10cpuidle: Checking the zero latency inside the governors does not make sense.drivers/cpuidle/governors/ladder.c drivers/cpuidle/governors/menu.c kernel/sched/idle.c+8 -101 reply
3/10sched: idle: cpudidle: Pass the latency req from idle.cdrivers/cpuidle/cpuidle.c drivers/cpuidle/governors/ladder.c drivers/cpuidle/governors/menu.c +2 more+12 -100 replies
4/10sched: idle: Compute next timer event and pass it the cpuidle frameworkdrivers/cpuidle/cpuidle.c drivers/cpuidle/governors/ladder.c drivers/cpuidle/governors/menu.c +2 more+20 -140 replies
5/10cpuidle: Remove unused headers for tickdrivers/cpuidle/cpuidle.c+0 -40 replies
6/10sched: idle: Add io latency information for the next eventdrivers/cpuidle/cpuidle.c drivers/cpuidle/governors/ladder.c drivers/cpuidle/governors/menu.c +2 more+32 -190 replies
7/10cpuidle: Add a simple select governordrivers/cpuidle/Kconfig drivers/cpuidle/governors/Makefile drivers/cpuidle/governors/select.c+60 -00 replies
8/10cpuidle: select: hack - increase rating to have this governor as defaultdrivers/cpuidle/governors/select.c+1 -10 replies
9/10cpuidle: sysfs: Add per cpu idle state prediction statisticsdrivers/cpuidle/cpuidle.c drivers/cpuidle/sysfs.c include/linux/cpuidle.h+170 -10 replies
10/10sched: io_latency: Tracking via bucketsinclude/linux/sched.h kernel/exit.c kernel/fork.c +3 more+304 -262 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFD PATCH 00/10] cpuidle: Predict the next events with the IO latencies

This patchset is not intended to be merged upstream as it is. It is a proof of concept giving the rough idea of the concept.

In the discussions on how to make the scheduler energy aware, we tried to make the different PM subsystems to communicate with the scheduler.

We realized that some code is duplicated across the PM subsystems and the scheduler leading to an inconsistent way to integrate the PM informations.

Ingo Molnar put a line in the sand [1] and clearly worded that no more PM stuff will be integrated into the scheduler until the different PM blocks are not redesigned to be part of the scheduler.

This patchset is a sub part of this integration work. How to integrate Cpuidle with the scheduler ?

The idea is to get rid of the governors and let the scheduler to tell the Cpuidle framework : "I expect to sleep <x> nsec and I have a <y> nsec latency requirement" as stated by Peter Zijlstra [2].

How to achieve this ?

We want to prevent to just move code around and put the prediction of the next event inside the scheduler directly with a legacy menu governor. After investigating, it appears the menu governor is not behaving in a stable way, it is erratic. Using the IO latencies + the timers give much better results than the menu governor which takes into account all the source of wakeups [3].

After discussing at the LPC2014 Dusseldorf, it appears the idea is good but the approach is wrong. The latency tracking must be done at the device level, per device and not in the task as what is doing this patchset.

Any comment, suggestion or help is welcome !

If I missed anyone who may be interested in this feature, please let me know.

Thanks.

-- Daniel

[1] http://lwn.net/Articles/552885/
[2] https://lkml.org/lkml/2013/11/11/353
[3] http://events.linuxfoundation.org/sites/events/files/slides/IOlatencyPrediction.pdf

Daniel Lezcano (10):
sched: add io latency framework
cpuidle: Checking the zero latency inside the governors does not make
sense.
sched: idle: cpudidle: Pass the latency req from idle.c
sched: idle: Compute next timer event and pass it the cpuidle
framework
cpuidle: Remove unused headers for tick
sched: idle: Add io latency information for the next event
cpuidle: Add a simple select governor
cpuidle: select: hack - increase rating to have this governor as
default
cpuidle: sysfs: Add per cpu idle state prediction statistics
sched: io_latency: Tracking via buckets

 drivers/cpuidle/Kconfig            |   4 +
 drivers/cpuidle/cpuidle.c          |  17 +-
 drivers/cpuidle/governors/Makefile |   1 +
 drivers/cpuidle/governors/ladder.c |  11 +-
 drivers/cpuidle/governors/menu.c   |  15 +-
 drivers/cpuidle/governors/select.c |  55 +++++
 drivers/cpuidle/sysfs.c            | 156 +++++++++++++
 include/linux/cpuidle.h            |  22 +-
 include/linux/sched.h              |  21 ++
 init/Kconfig                       |  11 +
 kernel/exit.c                      |   1 +
 kernel/fork.c                      |   5 +-
 kernel/sched/Makefile              |   1 +
 kernel/sched/core.c                |   7 +
 kernel/sched/idle.c                |  27 ++-
 kernel/sched/io_latency.c          | 441 +++++++++++++++++++++++++++++++++++++
 kernel/sched/io_latency.h          |  38 ++++
 17 files changed, 800 insertions(+), 33 deletions(-)
 create mode 100644 drivers/cpuidle/governors/select.c
 create mode 100644 kernel/sched/io_latency.c
 create mode 100644 kernel/sched/io_latency.h
Signature · 1 line
1.9.1