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, 26 Mar 2024 20:36:08 +0000
From: Lukasz Luba <lukasz.luba@....com>
To: Dietmar Eggemann <dietmar.eggemann@....com>
Cc: linux-arm-kernel@...ts.infradead.org, sboyd@...nel.org, nm@...com,
 linux-samsung-soc@...r.kernel.org, daniel.lezcano@...aro.org,
 rafael@...nel.org, viresh.kumar@...aro.org, krzysztof.kozlowski@...aro.org,
 alim.akhtar@...sung.com, m.szyprowski@...sung.com, mhiramat@...nel.org,
 linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org
Subject: Re: [RESEND][PATCH v2 2/4] PM: EM: Change the
 em_adjust_new_capacity() to re-use code



On 3/26/24 10:51, Dietmar Eggemann wrote:
> On 22/03/2024 12:08, Lukasz Luba wrote:
> 
> Maybe better : "PM: EM: Refactoring em_adjust_new_capacity()" ?
> 
>> There is going to be a new update function addressing chip binning.
>> Therefore, some common code which can be refactored and called from
>> upcoming changes and em_adjust_new_capacity(). In this way the code
>> duplication can be avoided.
> 
> IMHO, that's hard to digest.
> 
> Extract em_table_dup() and em_recalc_and_update() from
> em_adjust_new_capacity(). Both functions will be later reused by the
> 'update EM due to chip binning' functionality.

That looks good, I'll update it.

> 
> [...]
> 
>> +static int em_recalc_and_update(struct device *dev, struct em_perf_domain *pd,
>> +				struct em_perf_table __rcu *em_table)
>> +{
>> +	int ret;
>> +
>> +	ret = em_compute_costs(dev, em_table->state, NULL, pd->nr_perf_states,
>>   			       pd->flags);
>> -	if (ret) {
>> -		dev_warn(dev, "EM: compute costs failed\n");
>> -		return;
>> -	}
>> +	if (ret)
>> +		goto free_em_table;
> 
> There seems to be a subtle change in this patch. When em_compute_costs()
> fails now em_table_free() is called. This wasn't the case before when
> em_compute_costs() was directly called from em_adjust_new_capacity().

Yes, I've refactored it to explicitly call to the same free_em_table
for both fails in the new code. It should have been done in old code.

> 
> [...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ