Re: [patch v6 10/21] sched: get rq potential maximum utilization

From: Alex Shi
Date: Tue Apr 02 2013 - 21:12:20 EST


On 04/02/2013 10:38 PM, Vincent Guittot wrote:
>> +static unsigned int max_rq_util(int cpu)
>> > +{
>> > + struct rq *rq = cpu_rq(cpu);
>> > + unsigned int rt_util = scale_rt_util(cpu);
>> > + unsigned int cfs_util;
>> > + unsigned int nr_running;
>> > +
>> > + cfs_util = (FULL_UTIL - rt_util) > rq->util ? rq->util
>> > + : (FULL_UTIL - rt_util);
> rt_util and rq->util don't use the same computation algorithm so the
> results are hardly comparable or addable. In addition, some RT tasks
> can have impacted the rq->util, so they will be accounted in both
> side.

Thanks Vincent!

Yes, rt_util calculated with different way, but it has very similar
meaning with rq->util. So compare them make sense.

Yes, the rq->util and rt_util have some overlap, so we need to remove
the overlap part, otherwise the total utlization of this cpu will beyond
100%. that's not make sense. And since RT task always has higher
priority than cfs task, here I keep the RT utilization and yield the cfs
utilization.
>
> Vincent
>


--
Thanks Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/