/* get averaged number of queues of RT/BE priority. average is updated, with a formula that gives more weight to higher numbers, to quickly follows sudden increases and decrease slowly  */
static unsigned cfq_group_get_avg_queues(struct cfq_data *cfqd, struct cfq_group *cfqg, bool rt)
/* get averaged number of queues of RT/BE priority. average is updated, with a formula that gives more weight to higher numbers, to quickly follows sudden increases and decrease slowly  */
static unsigned cfq_group_get_avg_queues(struct cfq_data *cfqd, struct cfq_group *cfqg, bool rt)
{
	unsigned min_q, max_q;
	unsigned mult  = cfq_hist_divisor - 1;
	unsigned round = cfq_hist_divisor / 2;
	unsigned busy = cfq_group_busy_queues_wl(rt, cfqd, cfqg);
	min_q = min(cfqg->busy_queues_avg[rt], busy);
	max_q = max(cfqg->busy_queues_avg[rt], busy);
	cfqg->busy_queues_avg[rt] = (mult * max_q + min_q + round) /
		cfq_hist_divisor;
	return cfqg->busy_queues_avg[rt];
}