OSDN Git Service

sched: simplify CPU frequency estimation and cycle counter API
authorJoonwoo Park <joonwoop@codeaurora.org>
Wed, 18 May 2016 03:04:54 +0000 (20:04 -0700)
committerJeevan Shriram <jshriram@codeaurora.org>
Sat, 21 May 2016 02:23:47 +0000 (19:23 -0700)
commitd9ff0d77afb3e5b79973b402f9a65bafa7d0cbd6
treebdb0465b2e5ad2b01db6a2e1e80e21d1698551c6
parent167eebb0155f65077a1e5d57e3fb069fe9e6be70
sched: simplify CPU frequency estimation and cycle counter API

Most of CPUs increase cycle counter by one every cycle which makes
frequency = cycles / time_delta is correct.  Therefore it's reasonable
to get rid of current cpu_cycle_max_scale_factor and ask cycle counter
read callback function to return scaled counter value when it's needed
in such a case that cycle counter doesn't increase every cycle.

Thus multiply NSEC_PER_SEC / HZ_PER_KHZ to CPU cycle counter delta
as we calculate frequency in khz and remove cpu_cycle_max_scale_factor.
This allows us to simplify frequency estimation and cycle counter API.

Change-Id: Ie7a628d4bc77c9b6c769f6099ce8d75740262a14
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
include/linux/sched.h
kernel/sched/core.c
kernel/sched/sched.h