lkml.org 
[lkml]   [2015]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFCv5 PATCH 20/46] sched: Relocated get_cpu_usage() and change return type
On Wed, Aug 12, 2015 at 12:59:23PM +0200, Peter Zijlstra wrote:
> On Tue, Jul 07, 2015 at 07:24:03PM +0100, Morten Rasmussen wrote:
> > +static unsigned long get_cpu_usage(int cpu)
> > +{
> > + 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_orig = capacity_orig_of(cpu);
> > +
> > + sum = usage + blocked;
> > +
> > + if (sum >= capacity_orig)
> > + return capacity_orig;
> > +
> > + return sum;
> > +}
>
> Should sum then not also be unsigned long?

Yes it should. So much for my attempt at fixing the types :(


\
 
 \ /
  Last update: 2015-08-12 17:01    [W:0.151 / U:0.708 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site