From 07eb3f803b419bdebad45d846113dc069307be90 Mon Sep 17 00:00:00 2001 From: Joonwoo Park Date: Mon, 31 Aug 2015 17:21:35 -0700 Subject: sched: select task's prev_cpu as the best CPU when it was chosen recently Select given task's prev_cpu when the task slept for short period to reduce latency of task placement and migrations. A new tunable /proc/sys/kernel/sched_select_prev_cpu_us introduced to determine whether tasks are eligible to go through fast path. CRs-fixed: 947467 Change-Id: Ia507665b91f4e9f0e6ee1448d8df8994ead9739a [joonwoop@codeaurora.org: fixed conflict in include/linux/sched.h, include/linux/sched/sysctl.h, kernel/sched/core.c and kernel/sysctl.c] Signed-off-by: Joonwoo Park --- include/linux/sched.h | 1 + include/linux/sched/sysctl.h | 1 + 2 files changed, 2 insertions(+) (limited to 'include/linux') diff --git a/include/linux/sched.h b/include/linux/sched.h index d5275982df22..2125f214f287 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1458,6 +1458,7 @@ struct task_struct { */ u32 init_load_pct; u64 last_wake_ts; + u64 last_switch_out_ts; #endif #ifdef CONFIG_CGROUP_SCHED struct task_group *sched_task_group; diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h index 0663cf3c7410..bfea9efef2e9 100644 --- a/include/linux/sched/sysctl.h +++ b/include/linux/sched/sysctl.h @@ -70,6 +70,7 @@ extern unsigned int sysctl_early_detection_duration; extern unsigned int sysctl_sched_lowspill_freq; extern unsigned int sysctl_sched_pack_freq; extern unsigned int sysctl_sched_boost; +extern unsigned int sysctl_sched_select_prev_cpu_us; #if defined(CONFIG_SCHED_FREQ_INPUT) extern unsigned int sysctl_sched_new_task_windows; #endif -- cgit v1.2.3