lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150324113651.GE18994@e105550-lin.cambridge.arm.com>
Date:	Tue, 24 Mar 2015 11:36:51 +0000
From:	Morten Rasmussen <morten.rasmussen@....com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	"mingo@...hat.com" <mingo@...hat.com>,
	"vincent.guittot@...aro.org" <vincent.guittot@...aro.org>,
	Dietmar Eggemann <Dietmar.Eggemann@....com>,
	"yuyang.du@...el.com" <yuyang.du@...el.com>,
	"preeti@...ux.vnet.ibm.com" <preeti@...ux.vnet.ibm.com>,
	"mturquette@...aro.org" <mturquette@...aro.org>,
	"nico@...aro.org" <nico@...aro.org>,
	"rjw@...ysocki.net" <rjw@...ysocki.net>,
	Juri Lelli <Juri.Lelli@....com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFCv3 PATCH 28/48] sched: Use capacity_curr to cap utilization
 in get_cpu_usage()

On Mon, Mar 23, 2015 at 04:14:00PM +0000, Peter Zijlstra wrote:
> 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.

capacity_curr_of() is used in the if-condition itself as well so we need
it unconditionally. No?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ