From: Nick Piggin <nickpiggin@yahoo.com.au>
"Siddha, Suresh B" <suresh.b.siddha@intel.com> noticed a problem in the
cpu_load averaging where the integer truncation could sometimes cause cpu_load
to never quite reach its target.
I'm not sure that you could demonstrate a real world problem, but I quite
like this fix.
/* Update our load */
old_load = this_rq->cpu_load;
this_load = this_rq->nr_running * SCHED_LOAD_SCALE;
+ /*
+ * Round up the averaging division if load is increasing. This
+ * prevents us from getting stuck on 9 if the load is 10, for
+ * example.
+ */
+ if (this_load > old_load)
+ old_load++;
this_rq->cpu_load = (old_load + this_load) / 2;
for_each_domain(this_cpu, sd) {