Messages in this thread | | | Date | Wed, 03 Apr 2013 09:11:50 +0800 | From | Alex Shi <> | Subject | Re: [patch v6 10/21] sched: get rq potential maximum utilization |
| |
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
| |