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

From: Alex Shi
Date: Wed Apr 03 2013 - 04:08:50 EST


On 04/03/2013 10:22 AM, Paul Turner wrote:
> On Tue, Apr 2, 2013 at 7:15 PM, Alex Shi <alex.shi@xxxxxxxxx> 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 proper min/max().
>>>
>>>>> +
>>>>> + return rt_util + cfs_util * nr_running;
>>> Should this nr_running consider tasks in cfs_rq only?
>>
>> use nr_running of cfs_rq seems better, but when use sched autogroup,
>> only cfs->nr_running just the active group number, not the total active
>> task number. :(
>
> Why not just use cfs_rq->h_nr_running? This is always the total
> *tasks* in he hierarchy parented that cfs_rq. (This also has the nice property
> of not including group_entities.)
>

Thanks for Namhyung and PJT's suggestions!
patch updated!