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: <20190222105957.wxhlcmoag5f3i4fi@queper01-lin>
Date:   Fri, 22 Feb 2019 10:59:59 +0000
From:   Quentin Perret <quentin.perret@....com>
To:     Chunyan Zhang <chunyan.zhang@...soc.com>
Cc:     Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Vincent Wang <vincent.wang@...soc.com>,
        linux-kernel@...r.kernel.org, Chunyan Zhang <zhang.lyra@...il.com>
Subject: Re: [PATCH V4] sched/cpufreq: initialize iowait_boost_max and
 iowait_boost with cpu capacity

On Friday 22 Feb 2019 at 18:37:46 (+0800), Chunyan Zhang wrote:
> @@ -823,6 +823,8 @@ static int sugov_start(struct cpufreq_policy *policy)
>  {
>  	struct sugov_policy *sg_policy = policy->governor_data;
>  	unsigned int cpu;
> +	unsigned long max_cap = arch_scale_cpu_capacity(NULL, policy->cpu);
> +	unsigned long min_cap = max_cap * policy->min / policy->cpuinfo.max_freq;
>  
>  	sg_policy->freq_update_delay_ns	= sg_policy->tunables->rate_limit_us * NSEC_PER_USEC;
>  	sg_policy->last_freq_update_time	= 0;
> @@ -837,7 +839,9 @@ static int sugov_start(struct cpufreq_policy *policy)
>  		memset(sg_cpu, 0, sizeof(*sg_cpu));
>  		sg_cpu->cpu			= cpu;
>  		sg_cpu->sg_policy		= sg_policy;
> -		sg_cpu->iowait_boost_max	= policy->cpuinfo.max_freq;
> +		sg_cpu->max			= max_cap;
> +		sg_cpu->min			= min_cap;
> +		sg_cpu->iowait_boost_max	= max_cap;

Unfortunately, I don't think you can do that only here. The return value
of arch_scale_cpu_capacity() can change at run time. And it does on arm64,
see drivers/base/arch_topology.c.

>  	}
>  
>  	for_each_cpu(cpu, policy->cpus) {
> -- 
> 2.17.1
> 

Thanks,
Quentin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ