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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171130160345.GI9903@localhost.localdomain>
Date:   Thu, 30 Nov 2017 17:03:45 +0100
From:   Juri Lelli <juri.lelli@...hat.com>
To:     Patrick Bellasi <patrick.bellasi@....com>
Cc:     linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
        Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        "Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
        Viresh Kumar <viresh.kumar@...aro.org>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Morten Rasmussen <morten.rasmussen@....com>,
        Todd Kjos <tkjos@...roid.com>,
        Joel Fernandes <joelaf@...gle.com>,
        Steve Muckle <smuckle.linux@...il.com>
Subject: Re: [PATCH v3 2/6] cpufreq: schedutil: ensure max frequency while
 running RT/DL tasks

On 30/11/17 15:45, Patrick Bellasi wrote:
> On 30-Nov 14:17, Juri Lelli wrote:
> > Hi,
> > 
> > On 30/11/17 11:47, Patrick Bellasi wrote:
> > 
> > [...]
> > 
> > > @@ -340,6 +349,7 @@ static void sugov_update_shared(struct update_util_data *hook, u64 time,
> > >  	struct sugov_policy *sg_policy = sg_cpu->sg_policy;
> > >  	unsigned long util, max;
> > >  	unsigned int next_f;
> > > +	bool rt_mode;
> > >  
> > >  	sugov_get_util(&util, &max, sg_cpu->cpu);
> > >  
> > > @@ -353,17 +363,27 @@ static void sugov_update_shared(struct update_util_data *hook, u64 time,
> > >  		sg_cpu->flags = 0;
> > >  		goto done;
> > >  	}
> > > -	sg_cpu->flags = flags;
> > > +
> > > +	/*
> > > +	 * While RT/DL tasks are running we do not want FAIR tasks to
> > > +	 * overwrite this CPU's flags, still we can update utilization and
> > > +	 * frequency (if required/possible) to be fair with these tasks.
> > > +	 */
> > > +	rt_mode = task_has_dl_policy(current) ||
> > > +		  task_has_rt_policy(current) ||
> > > +		  (flags & SCHED_CPUFREQ_RT_DL);
> > > +	if (rt_mode)
> > > +		sg_cpu->flags |= flags;
> > > +	else
> > > +		sg_cpu->flags = flags;
> > >  
> > >  	sugov_set_iowait_boost(sg_cpu, time, flags);
> > >  	sg_cpu->last_update = time;
> > >  
> > >  	if (sugov_should_update_freq(sg_policy, time)) {
> > > -		if (flags & SCHED_CPUFREQ_RT_DL)
> > > -			next_f = sg_policy->policy->cpuinfo.max_freq;
> > > -		else
> > > -			next_f = sugov_next_freq_shared(sg_cpu, time);
> > > -
> > > +		next_f = rt_mode
> > > +			? sg_policy->policy->cpuinfo.max_freq
> > > +			: sugov_next_freq_shared(sg_cpu, time);
> > >  		sugov_update_commit(sg_policy, time, next_f);
> > 
> > Aren't we already at max_freq at this point (since an RT/DL task is
> > running)? Do we need to trigger a frequency update?
> 
> I think that's required to cover the first time we enter rt_mode in
> order to jump to max OPP.
> 
> If we are already at max OPP, sugov_update_commit() will just bail out
> without doing anything.

Indeed!

Best,

Juri

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ