summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJunjie Wu <junjiew@codeaurora.org>2015-06-09 17:36:11 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 21:25:29 -0700
commit3eb23fd73cdde9176d3c5e8d6a39c7eacb446436 (patch)
treea4d2b043c0db237e56c48bd6ceec6b9e0434679e /include
parent1a76fe2389d173d6bbe4fd12e078205fe0095a4c (diff)
cpufreq: interactive: Use load prediction provided by scheduler
With modification in scheduler, governor now gets predicted instantaneous demand waiting to run in addition to demand from previous window for each CPU. Make use of this information since prediction from scheduler could be more accurate than just looking at past few windows. Governor calculates two frequencies during each sampling period: one based on demand in previous sampling period (f_prev), and the other based on prediction provided by scheduler (f_pred). Max of both will be selected as final frequency. Hispeed related logic, including both frequency selection and delay is ignored when prediction is enabled. If only f_pred but not f_prev picked policy->max, max_freq_hysteresis period is not started/extended. This is to reduce power cost of mis-prediction if it happens. One use case prediction could dramatically help is when a heavy task wakes up after sleeping for a long time. With prediction, governor could ramp up to frequency the task needs much faster than before. To enable prediction, echo 1 to enable_prediction file in cpufreq interactive sysfs directory. Change-Id: I27396785886e43ea01c9000c651c8bd142172273 Suggested-by: Saravana Kannan <skannan@codeaurora.org> Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
Diffstat (limited to 'include')
-rw-r--r--include/trace/events/cpufreq_interactive.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/include/trace/events/cpufreq_interactive.h b/include/trace/events/cpufreq_interactive.h
index e1c7ec521ea8..61992e64fd18 100644
--- a/include/trace/events/cpufreq_interactive.h
+++ b/include/trace/events/cpufreq_interactive.h
@@ -119,21 +119,27 @@ TRACE_EVENT(cpufreq_interactive_load_change,
);
TRACE_EVENT(cpufreq_interactive_cpuload,
- TP_PROTO(unsigned long cpu_id, unsigned long load,
- unsigned int new_task_pct),
- TP_ARGS(cpu_id, load, new_task_pct),
+ TP_PROTO(unsigned long cpu_id, unsigned int load,
+ unsigned int new_task_pct, unsigned int prev,
+ unsigned int predicted),
+ TP_ARGS(cpu_id, load, new_task_pct, prev, predicted),
TP_STRUCT__entry(
__field(unsigned long, cpu_id)
- __field(unsigned long, load)
- __field(unsigned long, new_task_pct)
+ __field(unsigned int, load)
+ __field(unsigned int, new_task_pct)
+ __field(unsigned int, prev)
+ __field(unsigned int, predicted)
),
TP_fast_assign(
__entry->cpu_id = cpu_id;
__entry->load = load;
__entry->new_task_pct = new_task_pct;
+ __entry->prev = prev;
+ __entry->predicted = predicted;
),
- TP_printk("cpu=%lu load=%lu new_task_pct=%lu", __entry->cpu_id,
- __entry->load, __entry->new_task_pct)
+ TP_printk("cpu=%lu load=%u new_task_pct=%u prev=%u predicted=%u",
+ __entry->cpu_id, __entry->load, __entry->new_task_pct,
+ __entry->prev, __entry->predicted)
);
#endif /* _TRACE_CPUFREQ_INTERACTIVE_H */