diff options
| author | Joonwoo Park <joonwoop@codeaurora.org> | 2016-03-08 13:46:04 -0800 |
|---|---|---|
| committer | Kyle Yan <kyan@codeaurora.org> | 2016-04-27 19:13:05 -0700 |
| commit | 35f1d99e0a3ad7f1b15ca2085ca92fd545dd01de (patch) | |
| tree | a52e8cb3208ee558621098b70e3b41645a9c1ef3 /include/linux | |
| parent | 343dcf1ecc085671982de5de6212dbad827bbf1a (diff) | |
sched: add support for CPU frequency estimation with cycle counter
At present scheduler calculates task's demand with the task's execution
time weighted over CPU frequency. The CPU frequency is given by
governor's CPU frequency transition notification. Such notification
may not be available.
Provide an API for CPU clock driver to register callback functions so
in order for scheduler to access CPU's cycle counter to estimate CPU's
frequency without notification. At time point scheduler assumes the
cycle counter increases always even when cluster is idle which might
not be true. This will be fixed by subsequent change for more accurate
I/O wait time accounting.
CRs-fixed: 1006303
Change-Id: I93b187efd7bc225db80da0184683694f5ab99738
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/sched.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 7ece18efd02b..5c2534a3b818 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1470,6 +1470,7 @@ struct task_struct { u64 last_switch_out_ts; struct related_thread_group *grp; struct list_head grp_list; + u64 cpu_cycles; #endif #ifdef CONFIG_CGROUP_SCHED struct task_group *sched_task_group; @@ -3358,4 +3359,10 @@ static inline unsigned long rlimit_max(unsigned int limit) return task_rlimit_max(current, limit); } +struct cpu_cycle_counter_cb { + u64 (*get_cpu_cycle_counter)(int cpu); + u32 (*get_cpu_cycles_max_per_us)(int cpu); +}; +int register_cpu_cycle_counter_cb(struct cpu_cycle_counter_cb *cb); + #endif |
