diff options
| author | Syed Rameez Mustafa <rameezmustafa@codeaurora.org> | 2015-09-15 12:17:51 -0700 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:02:34 -0700 |
| commit | c00814c0239669d018214458469fb0194a6dc603 (patch) | |
| tree | 0303b42980e52f9f31edb1162f8146226bdcd720 /include | |
| parent | a805e4b2203d601f0ff64e5eed70a4ce202e824e (diff) | |
sched: Notify cpufreq governor early about potential big tasks
Tasks that are on the runqueue continuously for a certain amount of time
have the potential to be big tasks at the end of the window in which they
are runnable. In such scenarios ramping the CPU frequency early can
boost performance rather than waiting till the end of a window for the
governor to query load. Notify the governor early at every tick when a
task has been observed to execute beyond some percentage of the tick
period.
The threshold beyond which a task is eligible for early detection can be
changed via the tunable sched_early_detection_duration. The feature itself
is enabled only when scheduler boost is in effect.
Change-Id: I528b72bbc79a55b4593d1b8ab45450411c6d70f3
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
[joonwoop@codeaurora.org: fixed conflict in scheduler_tick() in
kernel/sched/core.c. fixed minor conflicts in include/linux/sched.h,
include/linux/sched/sysctl.h and kernel/sysctl.c due to
CONFIG_SCHED_QHMP.]
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/sched.h | 1 | ||||
| -rw-r--r-- | include/linux/sched/sysctl.h | 1 | ||||
| -rw-r--r-- | include/trace/events/sched.h | 10 |
3 files changed, 8 insertions, 4 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index fc0f5db45791..865c796ae27f 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1457,6 +1457,7 @@ struct task_struct { * of this task */ u32 init_load_pct; + u64 last_wake_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 0fb660306a9f..0663cf3c7410 100644 --- a/include/linux/sched/sysctl.h +++ b/include/linux/sched/sysctl.h @@ -66,6 +66,7 @@ extern unsigned int sysctl_sched_upmigrate_pct; extern unsigned int sysctl_sched_downmigrate_pct; extern int sysctl_sched_upmigrate_min_nice; extern unsigned int sysctl_sched_powerband_limit_pct; +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; diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index 235b61182e64..1a215ba026b5 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h @@ -408,24 +408,26 @@ TRACE_EVENT(sched_migration_update_sum, TRACE_EVENT(sched_get_busy, - TP_PROTO(int cpu, u64 load, u64 nload), + TP_PROTO(int cpu, u64 load, u64 nload, int early), - TP_ARGS(cpu, load, nload), + TP_ARGS(cpu, load, nload, early), TP_STRUCT__entry( __field( int, cpu ) __field( u64, load ) __field( u64, nload ) + __field( int, early ) ), TP_fast_assign( __entry->cpu = cpu; __entry->load = load; __entry->nload = nload; + __entry->early = early; ), - TP_printk("cpu %d load %lld new_task_load %lld", - __entry->cpu, __entry->load, __entry->nload) + TP_printk("cpu %d load %lld new_task_load %lld early %d", + __entry->cpu, __entry->load, __entry->nload, __entry->early) ); TRACE_EVENT(sched_freq_alert, |
