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

2013-04-03 Thread Alex Shi
On 04/03/2013 10:22 AM, Paul Turner wrote: > On Tue, Apr 2, 2013 at 7:15 PM, Alex Shi wrote: >> On 04/02/2013 05:02 PM, Namhyung Kim wrote: > + cfs_util = (FULL_UTIL - rt_util) > rq->util ? rq->util > + : (FULL_UTIL - rt_util); > + nr_running = rq->nr_running ? rq->n

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

2013-04-02 Thread Alex Shi
On 04/03/2013 10:22 AM, Paul Turner wrote: > On Tue, Apr 2, 2013 at 7:15 PM, Alex Shi wrote: >> On 04/02/2013 05:02 PM, Namhyung Kim wrote: > + cfs_util = (FULL_UTIL - rt_util) > rq->util ? rq->util > + : (FULL_UTIL - rt_util); > + nr_running = rq->nr_running ? rq->n

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

2013-04-02 Thread Paul Turner
On Tue, Apr 2, 2013 at 7:15 PM, Alex Shi wrote: > On 04/02/2013 05:02 PM, Namhyung Kim wrote: >>> > + cfs_util = (FULL_UTIL - rt_util) > rq->util ? rq->util >>> > + : (FULL_UTIL - rt_util); >>> > + nr_running = rq->nr_running ? rq->nr_running : 1; >> This can be cleaned up with

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

2013-04-02 Thread Alex Shi
On 04/02/2013 05:02 PM, Namhyung Kim wrote: >> > + cfs_util = (FULL_UTIL - rt_util) > rq->util ? rq->util >> > + : (FULL_UTIL - rt_util); >> > + nr_running = rq->nr_running ? rq->nr_running : 1; > This can be cleaned up with proper min/max(). > >> > + >> > + return rt_util + cf

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

2013-04-02 Thread Alex Shi
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_uti

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

2013-04-02 Thread Vincent Guittot
On 30 March 2013 15:34, Alex Shi wrote: > Since the rt task priority is higher than fair tasks, cfs_rq utilization > is just the left of rt utilization. > > When there are some cfs tasks in queue, the potential utilization may > be yielded, so mulitiplying cfs task number to get max potential > ut

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

2013-04-02 Thread Alex Shi
>> +nr_running = rq->nr_running ? rq->nr_running : 1; > > This can be cleaned up with proper min/max(). yes, thanks > >> + >> +return rt_util + cfs_util * nr_running; > > Should this nr_running consider tasks in cfs_rq only? Also it seems > there's no upper bound so that it can possib

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

2013-04-02 Thread Namhyung Kim
Hi Alex, On Sat, 30 Mar 2013 22:34:57 +0800, Alex Shi wrote: > Since the rt task priority is higher than fair tasks, cfs_rq utilization > is just the left of rt utilization. > > When there are some cfs tasks in queue, the potential utilization may > be yielded, so mulitiplying cfs task number to g