lkml.org 
[lkml]   [2015]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [RFCv3 PATCH 28/48] sched: Use capacity_curr to cap utilization in get_cpu_usage()
On Wed, Feb 04, 2015 at 06:31:05PM +0000, Morten Rasmussen wrote:

> @@ -4596,9 +4596,10 @@ static int get_cpu_usage(int cpu)
> {
> 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 >= SCHED_LOAD_SCALE)
> - return capacity_orig_of(cpu);
> + if (usage + blocked >= capacity_curr)
> + return capacity_curr;

It makes more sense to do return capacity_curr_of(), since that defers
the computation capacity_curr_of() does to the point where its actually
required, instead of making it unconditional.


\
 
 \ /
  Last update: 2015-03-23 17:21    [W:0.514 / U:1.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site