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: <20231228180647.rwz4u7ebk5p2hjcr@airbuntu>
Date: Thu, 28 Dec 2023 18:06:47 +0000
From: Qais Yousef <qyousef@...alina.io>
To: Lukasz Luba <lukasz.luba@....com>
Cc: linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
	rafael@...nel.org, dietmar.eggemann@....com, rui.zhang@...el.com,
	amit.kucheria@...durent.com, amit.kachhap@...il.com,
	daniel.lezcano@...aro.org, viresh.kumar@...aro.org,
	len.brown@...el.com, pavel@....cz, mhiramat@...nel.org,
	wvw@...gle.com
Subject: Re: [PATCH v5 15/23] PM: EM: Optimize em_cpu_energy() and remove
 division

On 11/29/23 11:08, Lukasz Luba wrote:

> @@ -220,8 +218,9 @@ static int em_compute_costs(struct device *dev, struct em_perf_state *table,
>  				return -EINVAL;
>  			}
>  		} else {
> -			power_res = table[i].power;
> -			cost = div64_u64(fmax * power_res, table[i].frequency);
> +			/* increase resolution of 'cost' precision */
> +			power_res = table[i].power * 10;

Power is in uW, right? You're just taking advantage here that everything will
use this new cost field so you can add as many 0s to improve resolution without
impact elsewhere that care to compare using the same units?

Did you see a problem or just being extra cautious here?

> +			cost = power_res / table[i].performance;
>  		}
>  
>  		table[i].cost = cost;
> -- 
> 2.25.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ