[RFC][PATCH 0/2] sched: Power optimizations with SCHED_IDLE

From: Viresh Kumar
Date: Mon Nov 26 2018 - 06:21:06 EST


Hello,

The intention behind sending this series is to get some initial feedback
on the idea of specially handling CPUs which only have SCHED_IDLE
activity enqueued on them, before investing too much effort on it. The
current implementation handles very few code-paths and there is a lot
more that we would need to do to make it work well for us.

This allows enqueuing more tasks to a CPUs which only have tasks with
SCHED_IDLE policy currently, as the new tasks should run on them without
any significant delays. And this avoids waking up an otherwise idle CPU,
hence save power without impacting performance.

We don't have lots of SCHED_IDLE tasks in Android currently, but it
should be possible to convert a few of the background tasks and take
advantage of this feature.

Only basic testing is done with the help of rt-app [1] currently to make
sure the task is getting placed correctly.

--
viresh

Viresh Kumar (2):
sched: Start tracking SCHED_IDLE tasks count in cfs_rq
sched: Enqueue tasks on a cpu with only SCHED_IDLE tasks

kernel/sched/core.c | 23 ++++++++++++++++
kernel/sched/fair.c | 64 +++++++++++++++++++++++++++++++++-----------
kernel/sched/sched.h | 5 ++++
3 files changed, 76 insertions(+), 16 deletions(-)

--
2.19.1.568.g152ad8e3369a

[1] json: https://pastebin.ubuntu.com/p/Y4fr9xddV8/