diff options
| author | Srivatsa Vaddagiri <vatsa@codeaurora.org> | 2014-09-01 13:26:53 +0530 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:00:50 -0700 |
| commit | 3a67b4ce87bf96312d4c5728047d830a66258854 (patch) | |
| tree | bd392503fe5c0f2da5231f1865cc86fd8b7b0672 /include/linux | |
| parent | 977dc392f77522559697cbedfb2d48ad7be96aec (diff) | |
sched: window-stats: Enhance cpu busy time accounting
rq->curr/prev_runnable_sum counters represent cpu demand from various
tasks that have run on a cpu. Any task that runs on a cpu will have a
representation in rq->curr_runnable_sum. Their partial_demand value
will be included in rq->curr_runnable_sum. Since partial_demand is
derived from historical load samples for a task, rq->curr_runnable_sum
could represent "inflated/un-realistic" cpu usage. As an example, lets
say that task with partial_demand of 10ms runs for only 1ms on a cpu.
What is included in rq->curr_runnable_sum is 10ms (and not the actual
execution time of 1ms). This leads to cpu busy time being reported on
the upside causing frequency to stay higher than necessary.
This patch fixes cpu busy accounting scheme to strictly represent
actual usage. It also provides for conditional fixup of busy time upon
migration and upon heavy-task wakeup.
CRs-Fixed: 691443
Change-Id: Ic4092627668053934049af4dfef65d9b6b901e6b
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
[joonwoop@codeaurora.org: fixed conflict in init_task_load(),
se.avg.decay_count has deprecated.]
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/sched.h | 20 | ||||
| -rw-r--r-- | include/linux/sched/sysctl.h | 4 |
2 files changed, 17 insertions, 7 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 09974bc791ea..31a9756b06dc 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -314,6 +314,8 @@ extern char ___assert_task_state[1 - 2*!!( /* Task command name length */ #define TASK_COMM_LEN 16 +extern const char *sched_window_reset_reasons[]; + enum task_event { PUT_PREV_TASK = 0, PICK_NEXT_TASK = 1, @@ -1212,7 +1214,7 @@ struct sched_avg { u64 last_update_time, load_sum; u32 util_sum, period_contrib; unsigned long load_avg, util_avg; -#if defined(CONFIG_SCHED_FREQ_INPUT) || defined(CONFIG_SCHED_HMP) +#ifdef CONFIG_SCHED_HMP u32 runnable_avg_sum_scaled; #endif }; @@ -1273,12 +1275,18 @@ struct ravg { * sysctl_sched_ravg_hist_size windows. 'demand' could drive frequency * demand for tasks. * - * 'flags' can have either or both of PREV_WINDOW_CONTRIB and - * CURR_WINDOW_CONTRIB set. + * 'curr_window' represents task's contribution to cpu busy time + * statistics (rq->curr_runnable_sum) in current window + * + * 'prev_window' represents task's contribution to cpu busy time + * statistics (rq->prev_runnable_sum) in previous window */ u64 mark_start; - u32 sum, demand, partial_demand, flags; + u32 sum, demand; u32 sum_history[RAVG_HIST_SIZE_MAX]; +#ifdef CONFIG_SCHED_FREQ_INPUT + u32 curr_window, prev_window; +#endif }; struct sched_entity { @@ -1438,7 +1446,7 @@ struct task_struct { const struct sched_class *sched_class; struct sched_entity se; struct sched_rt_entity rt; -#if defined(CONFIG_SCHED_FREQ_INPUT) || defined(CONFIG_SCHED_HMP) +#ifdef CONFIG_SCHED_HMP struct ravg ravg; #endif #ifdef CONFIG_CGROUP_SCHED @@ -2545,7 +2553,7 @@ extern void wake_up_new_task(struct task_struct *tsk); #endif extern int sched_fork(unsigned long clone_flags, struct task_struct *p); extern void sched_dead(struct task_struct *p); -#if defined(CONFIG_SCHED_HMP) || defined(CONFIG_SCHED_FREQ_INPUT) +#ifdef CONFIG_SCHED_HMP extern void sched_exit(struct task_struct *p); #else static inline void sched_exit(struct task_struct *p) { } diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h index 411812931a26..a87dec5a4e10 100644 --- a/include/linux/sched/sysctl.h +++ b/include/linux/sched/sysctl.h @@ -44,8 +44,10 @@ extern unsigned int sysctl_sched_wakeup_load_threshold; extern unsigned int sysctl_sched_window_stats_policy; extern unsigned int sysctl_sched_account_wait_time; extern unsigned int sysctl_sched_ravg_hist_size; -extern unsigned int sysctl_sched_freq_legacy_mode; extern unsigned int sysctl_sched_gov_response_time; +extern unsigned int sysctl_sched_freq_account_wait_time; +extern unsigned int sysctl_sched_migration_fixup; +extern unsigned int sysctl_sched_heavy_task_pct; #if defined(CONFIG_SCHED_FREQ_INPUT) || defined(CONFIG_SCHED_HMP) extern unsigned int sysctl_sched_init_task_load_pct; |
