/* Update rq->cpu_load statistics. This function is usually called every scheduler tick (TICK_NSEC).  */
static void update_cpu_load(struct rq *this_rq)
/* Update rq->cpu_load statistics. This function is usually called every scheduler tick (TICK_NSEC).  */
static void update_cpu_load(struct rq *this_rq)
{
	unsigned long this_load = this_rq->load.weight;
	int i, scale;
	this_rq->nr_load_updates++;
	for (i = 0, scale = 1; i < CPU_LOAD_IDX_MAX; i++, scale += scale) {
		unsigned long old_load, new_load;
		old_load = this_rq->cpu_load[i];
		new_load = this_load;
		if (new_load > old_load)
			new_load += scale-1;
		this_rq->cpu_load[i] = (old_load*(scale-1) + new_load) >> i;
	}
	if (time_after_eq(jiffies, this_rq->calc_load_update)) {
		this_rq->calc_load_update += LOAD_FREQ;
		calc_load_account_active(this_rq);
	}
}