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: <20170411103556.GC13627@vireshk-i7>
Date:   Tue, 11 Apr 2017 16:05:56 +0530
From:   Viresh Kumar <viresh.kumar@...aro.org>
To:     "Rafael J. Wysocki" <rjw@...ysocki.net>
Cc:     Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        linaro-kernel@...ts.linaro.org, linux-pm@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Vincent Guittot <vincent.guittot@...aro.org>,
        smuckle.linux@...il.com, juri.lelli@....com,
        Morten.Rasmussen@....com, patrick.bellasi@....com,
        eas-dev@...ts.linaro.org
Subject: Re: [RFC 5/9] sched: cpufreq: remove smp_processor_id() in remote
 paths

On 29-03-17, 23:28, Rafael J. Wysocki wrote:
> On Thursday, March 09, 2017 05:15:15 PM Viresh Kumar wrote:
> > @@ -216,7 +216,7 @@ static void sugov_update_single(struct update_util_data *hook, u64 time,
> >  	if (flags & SCHED_CPUFREQ_RT_DL) {
> >  		next_f = policy->cpuinfo.max_freq;
> >  	} else {
> > -		sugov_get_util(&util, &max);
> > +		sugov_get_util(&util, &max, hook->cpu);
> 
> Why is this not racy?

Why would reading the utilization values be racy? The only dynamic value here is
"util_avg" and I am not sure if reading it is racy.

But, this whole routine has races which I ignored as we may end up updating
frequency simultaneously from two threads.

> >  		sugov_iowait_boost(sg_cpu, &util, &max);
> >  		next_f = get_next_freq(sg_policy, util, max);
> >  	}
> > @@ -272,7 +272,7 @@ static void sugov_update_shared(struct update_util_data *hook, u64 time,
> >  	unsigned long util, max;
> >  	unsigned int next_f;
> >  
> > -	sugov_get_util(&util, &max);
> > +	sugov_get_util(&util, &max, hook->cpu);
> >  
> 
> And here?
> 
> >  	raw_spin_lock(&sg_policy->update_lock);

The lock prevents the same here though.

So, if we are going to use this series, then we can use the same update-lock in
case of single cpu per policies as well.

-- 
viresh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ