lkml.org 
[lkml]   [2015]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFCv3 PATCH 31/48] sched: Extend sched_group_energy to test load-balancing decisions
On 30/04/15 08:00, pang.xunlei@zte.com.cn wrote:
> linux-kernel-owner@vger.kernel.org wrote 2015-02-05 AM 02:31:08:

[...]

>> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
>> index d12aa63..07c84af 100644
>> --- a/kernel/sched/fair.c
>> +++ b/kernel/sched/fair.c
>> @@ -4592,23 +4592,44 @@ static unsigned long capacity_curr_of(int cpu)
>> * Without capping the usage, a group could be seen as overloaded
> (CPU0 usage
>> * at 121% + CPU1 usage at 80%) whereas CPU1 has 20% of available
> capacity/
>> */
>> -static int get_cpu_usage(int cpu)
>> +static int __get_cpu_usage(int cpu, int delta)
>> {
>> + int sum;
>> unsigned long usage = cpu_rq(cpu)->cfs.utilization_load_avg;
>> unsigned long blocked = cpu_rq(cpu)->cfs.utilization_blocked_avg;
>> unsigned long capacity_curr = capacity_curr_of(cpu);
>>
>> - if (usage + blocked >= capacity_curr)
>> + sum = usage + blocked + delta;
>> +
>> + if (sum < 0)
>> + return 0;
>> +
>> + if (sum >= capacity_curr)
>> return capacity_curr;
>
> So if the added delta exceeds the curr capacity not its orignal capacity
> which I think would be quite often cases, I guess it should be better if
> it's allowed to increase its freq and calculate the right energy diff.

Yes, I mentioned this in my answer for [RFCv3 PATCH 17/48] that our
testing in the meantime has shown that this capping by capacity_curr is
the wrong approach in some cases and that we are likely to change this
to capacity_orig_of(cpu) in the next version.

[...]



\
 
 \ /
  Last update: 2015-04-30 23:01    [W:0.629 / U:1.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site