summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorJoonwoo Park <joonwoop@codeaurora.org>2016-03-04 17:15:04 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 21:25:23 -0700
commit16ecb20600bd0aa0037217fa3033e9a03a3f3c69 (patch)
treeabb69e563a8cae6c2e513aa6cc9cb194e1c23687 /kernel
parent616e04a51cf13b46cbe635a1d74996b596ccb736 (diff)
sched: restrict sync wakee placement bias with waker's demand
Biasing sync wakee task towards waker CPU's cluster makes sense when the waker's demand is high enough so the wakee also can take advantage of high CPU frequency voted because of waker's load. Placing sync wakee on the low demand waker's CPU can lead placement imbalance which can lead unnecessary migration. Introduce a new tunable "sched_big_waker_task_load" that defines the big waker so scheduler avoid wakee on waker's cluster bias when the waker's load is below the tunable. CRs-fixed: 971295 Change-Id: I1550ede0a71ac8c9be74a7daabe164c6a269a3fb Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org> [joonwoop@codeaurora.org: fixed a minor conflict in include/linux/sched/sysctl.h.]
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/fair.c8
-rw-r--r--kernel/sysctl.c7
2 files changed, 15 insertions, 0 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index aef2fbb9dbf5..e57b50ee752a 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2709,6 +2709,9 @@ unsigned int __read_mostly sysctl_sched_enable_power_aware = 0;
unsigned int __read_mostly sched_small_wakee_task_load;
unsigned int __read_mostly sysctl_sched_small_wakee_task_load_pct = 10;
+unsigned int __read_mostly sched_big_waker_task_load;
+unsigned int __read_mostly sysctl_sched_big_waker_task_load_pct = 25;
+
/*
* CPUs with load greater than the sched_spill_load_threshold are not
* eligible for task placement. When all CPUs in a cluster achieve a
@@ -2839,6 +2842,10 @@ void set_hmp_defaults(void)
sched_small_wakee_task_load =
div64_u64((u64)sysctl_sched_small_wakee_task_load_pct *
(u64)sched_ravg_window, 100);
+
+ sched_big_waker_task_load =
+ div64_u64((u64)sysctl_sched_big_waker_task_load_pct *
+ (u64)sched_ravg_window, 100);
}
u32 sched_get_init_task_load(struct task_struct *p)
@@ -3509,6 +3516,7 @@ static inline bool
wake_to_waker_cluster(struct cpu_select_env *env)
{
return !env->need_idle && !env->reason && env->sync &&
+ task_load(current) > sched_big_waker_task_load &&
task_load(env->p) < sched_small_wakee_task_load;
}
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 09d6882acb86..1da3b96368b1 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -449,6 +449,13 @@ static struct ctl_table kern_table[] = {
.mode = 0644,
.proc_handler = sched_hmp_proc_update_handler,
},
+ {
+ .procname = "sched_big_waker_task_load",
+ .data = &sysctl_sched_big_waker_task_load_pct,
+ .maxlen = sizeof(unsigned int),
+ .mode = 0644,
+ .proc_handler = sched_hmp_proc_update_handler,
+ },
#ifdef CONFIG_SCHED_FREQ_INPUT
{
.procname = "sched_new_task_windows",