]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commit
sched: Force sleep on consecutive sched_yields
authorSai Gurrappadi <sgurrappadi@nvidia.com>
Wed, 22 Jan 2014 00:41:37 +0000 (16:41 -0800)
committerDiwakar Tundlam <dtundlam@nvidia.com>
Tue, 4 Mar 2014 03:38:54 +0000 (19:38 -0800)
commit3bfdbefc2cf0ecf2933250813c356b3d147e59e0
treede830b9368a6ac8b3788fbb47054b7633771c8a0
parent33db1f7eb8e2d9eaad2dce65152cd5b2a4a27fae
sched: Force sleep on consecutive sched_yields

If a task sched_yields to itself continuously, force the task to
sleep in sched_yield. This will lower the CPU load of this task
thereby lowering the cpu frequency and improving power.

Added a stat variable to track how many times we sleep due these
consecutive sched_yields. Also added sysctl knobs to control the number
of consecutive sched_yields before which the sleep kicks in and the
duration fo the sleep in us.

Bug 1424617

Change-Id: Ie92412b8b900365816e17237fcbd0aac6e9c94ce
Signed-off-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-on: http://git-master/r/358455
Reviewed-by: Wen Yi <wyi@nvidia.com>
Reviewed-by: Peter Zu <pzu@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
include/linux/sched.h
include/linux/sched/sysctl.h
kernel/sched/core.c
kernel/sched/debug.c
kernel/sched/sched.h
kernel/sched/stats.c
kernel/sysctl.c