ANDROID: sched: fair/tune: Add schedtune with cgroups interface
authorPatrick Bellasi <patrick.bellasi@arm.com>
Sat, 21 Oct 2017 17:07:35 +0000 (18:07 +0100)
committerChris Redpath <chris.redpath@arm.com>
Tue, 19 Dec 2017 17:49:22 +0000 (17:49 +0000)
commit159c14f0397790405b9e8435184366b31f2ed15b
tree265e2b9d240697fa21833c21f0c609b14e7d7b3c
parent7f6fb825d6bc1e980181ca19adb2ef090001c882
ANDROID: sched: fair/tune: Add schedtune with cgroups interface

Schedtune is the framework we use in Android to allow userspace
task classification and provides a CGroup controller which has two
attributes per group.

 * schedtune.boost
 * schedtune.prefer_idle

Schedtune itself provides task and CPU utilization boosting. EAS in
the fair scheduler uses boosted utilization and prefer_idle status to
control the algorithm used for wakeup task placement.

Boosting:

The task utilization signal, which is derived from PELT signals and
properly scaled to be architecture and frequency invariant, is used by
EAS as an estimation of the task requirements in terms of CPU bandwidth.

Schedtune allows userspace to assign a percentage boost to each group
and this boost is used to calculate an additional utilization margin.
The margin added to the original utilization is:
 1. computed based on the "boosting strategy" in use
 2. proportional to boost value defined by the "taskgroup" value

The boosted signal is used by EAS for task placement, and boosted CPU
utilization (if boosted tasks are running) is given when schedutil
requests utilization.

Prefer_idle:

When this attribute is 1 for a group, this is used as a signal from
userspace that tasks in this group need to be serviced with the
minimum latency possible.

Previous versions of schedtune had much more functionality around
allowing a more tuneable tradeoff between performand and energy,
however this has not been used a lot up until now. If necessary,
we can easily resurrect it based upon old code.

Change-Id: Ie2fd63d82f604f34bcbc7e1ca9b5af1bdcc037e0
Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
Signed-off-by: Chris Redpath <chris.redpath@arm.com>
Documentation/scheduler/sched-tune.txt [new file with mode: 0644]
include/linux/cgroup_subsys.h
include/trace/events/sched.h
init/Kconfig
kernel/sched/Makefile
kernel/sched/cpufreq_schedutil.c
kernel/sched/fair.c
kernel/sched/tune.c [new file with mode: 0644]
kernel/sched/tune.h [new file with mode: 0644]