Messages in this thread Patch in this message | | | From | Nikhil Rao <> | Subject | [PATCH v1 05/19] sched: update this_cpu_load() to return u64 value | Date | Sun, 1 May 2011 18:19:03 -0700 |
| |
The idlecpu governor uses this_cpu_load() for calculations which is now returns u64. Update idlecpu governor to also use u64.
Signed-off-by: Nikhil Rao <ncrao@google.com> --- drivers/cpuidle/governors/menu.c | 5 ++--- include/linux/sched.h | 2 +- kernel/sched.c | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c index f508690..2051134 100644 --- a/drivers/cpuidle/governors/menu.c +++ b/drivers/cpuidle/governors/menu.c @@ -127,10 +127,9 @@ struct menu_device { static int get_loadavg(void) { - unsigned long this = this_cpu_load(); + u64 this = this_cpu_load(); - - return LOAD_INT(this) * 10 + LOAD_FRAC(this) / 10; + return div_u64(LOAD_INT(this) * 10 + LOAD_FRAC(this), 10); } static inline int which_bucket(unsigned int duration) diff --git a/include/linux/sched.h b/include/linux/sched.h index 6d88be1..546a418 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -140,7 +140,7 @@ extern unsigned long nr_running(void); extern unsigned long nr_uninterruptible(void); extern unsigned long nr_iowait(void); extern unsigned long nr_iowait_cpu(int cpu); -extern unsigned long this_cpu_load(void); +extern u64 this_cpu_load(void); extern void calc_global_load(unsigned long ticks); diff --git a/kernel/sched.c b/kernel/sched.c index 7badde6..f2eb816 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -3061,7 +3061,7 @@ unsigned long nr_iowait_cpu(int cpu) return atomic_read(&this->nr_iowait); } -unsigned long this_cpu_load(void) +u64 this_cpu_load(void) { struct rq *this = this_rq(); return this->cpu_load[0]; -- 1.7.3.1
| |