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]
Date:   Tue, 11 Jul 2017 13:39:45 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Viresh Kumar <viresh.kumar@...aro.org>
Cc:     Joel Fernandes <joelaf@...gle.com>, linux-kernel@...r.kernel.org,
        patrick.bellasi@....com, juri.lelli@....com,
        andresoportus@...gle.com, dietmar.eggemann@....com,
        Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
        Len Brown <lenb@...nel.org>,
        "Rafael J . Wysocki" <rjw@...ysocki.net>,
        Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH RFC v4] cpufreq: schedutil: Make iowait boost more energy
 efficient

On Tue, Jul 11, 2017 at 03:44:32PM +0530, Viresh Kumar wrote:
> On 09-07-17, 10:08, Joel Fernandes wrote:
> > diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
> > index 622eed1b7658..4d9e8b96bed1 100644
> > --- a/kernel/sched/cpufreq_schedutil.c
> > +++ b/kernel/sched/cpufreq_schedutil.c
> > @@ -53,7 +53,9 @@ struct sugov_cpu {
> >  	struct update_util_data update_util;
> >  	struct sugov_policy *sg_policy;
> >  
> > +	bool prev_iowait_boost;
> >  	unsigned long iowait_boost;
> > +	unsigned long iowait_boost_min;
> >  	unsigned long iowait_boost_max;
> >  	u64 last_update;
> >  
> > @@ -168,22 +170,47 @@ static void sugov_get_util(unsigned long *util, unsigned long *max)
> >  	*max = cfs_max;
> >  }
> >  
> > +static void sugov_decay_iowait_boost(struct sugov_cpu *sg_cpu)
> > +{
> > +	sg_cpu->iowait_boost >>= 1;
> > +
> > +	if (sg_cpu->iowait_boost < sg_cpu->iowait_boost_min)
> > +		sg_cpu->iowait_boost = 0;
> > +}
> > +
> >  static void sugov_set_iowait_boost(struct sugov_cpu *sg_cpu, u64 time,
> >  				   unsigned int flags)
> >  {
> >  	if (flags & SCHED_CPUFREQ_IOWAIT) {
> > -		sg_cpu->iowait_boost = sg_cpu->iowait_boost_max;
> > +		/* Remember for next time that we did an iowait boost */
> > +		sg_cpu->prev_iowait_boost = true;
> > +		if (sg_cpu->iowait_boost) {
> > +			sg_cpu->iowait_boost <<= 1;
> > +			sg_cpu->iowait_boost = min(sg_cpu->iowait_boost,
> > +						   sg_cpu->iowait_boost_max);
> > +		} else {
> > +			sg_cpu->iowait_boost = sg_cpu->iowait_boost_min;
> 
> I am not sure if boost should start from the min frequency, as the current
> frequency will at least be equal to that. Which means that with no boost
> initially, we will never increase the frequency for the first IOWAIT flag event.

I suspect this actually works for Joel to get rid of the transient
spikes he was seeing. Starting at the current freq, as you suggest,
appears to make sense, but would add immediate transients back.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ