Messages in this thread Patch in this message |  | | | From | Nikhil Rao <> | | Subject | [RFC][Patch 08/18] sched: update find_idlest_group() to use u64 | | Date | Wed, 20 Apr 2011 13:51:27 -0700 |
| |
Update find_idlest_group() to use u64 to accumulate and maintain cpu_load weights.
Signed-off-by: Nikhil Rao <ncrao@google.com> --- kernel/sched_fair.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 0b36548..029dd4f 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c @@ -1527,11 +1527,11 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p, int this_cpu, int load_idx) { struct sched_group *idlest = NULL, *group = sd->groups; - unsigned long min_load = ULONG_MAX, this_load = 0; + u64 min_load = ULLONG_MAX, this_load = 0; int imbalance = 100 + (sd->imbalance_pct-100)/2; do { - unsigned long load, avg_load; + u64 load, avg_load; int local_group; int i; @@ -1557,7 +1557,8 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p, } /* Adjust by relative CPU power of the group */ - avg_load = (avg_load * SCHED_POWER_SCALE) / group->cpu_power; + avg_load *= SCHED_POWER_SCALE; + avg_load = div_u64(avg_load, group->cpu_power); if (local_group) { this_load = avg_load; -- 1.7.3.1
|  |