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: Mon, 29 Jan 2024 19:13:57 +0100
From: Dietmar Eggemann <dietmar.eggemann@....com>
To: Lukasz Luba <lukasz.luba@....com>, linux-kernel@...r.kernel.org,
 linux-pm@...r.kernel.org, rafael@...nel.org
Cc: 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, qyousef@...alina.io, wvw@...gle.com,
 xuewen.yan94@...il.com
Subject: Re: [PATCH v7 13/23] PM: EM: Add performance field to struct
 em_perf_state and optimize

On 17/01/2024 09:57, Lukasz Luba wrote:

[...]

>  include/linux/energy_model.h | 24 ++++++++++++------------
>  kernel/power/energy_model.c  | 27 +++++++++++++++++++++++++++
>  2 files changed, 39 insertions(+), 12 deletions(-)
> 
> diff --git a/include/linux/energy_model.h b/include/linux/energy_model.h
> index 5ebe9dbec8e1..689d71f6b56f 100644
> --- a/include/linux/energy_model.h
> +++ b/include/linux/energy_model.h
> @@ -13,6 +13,7 @@
>  
>  /**
>   * struct em_perf_state - Performance state of a performance domain
> + * @performance:	CPU performance (capacity) at a given frequency

I guess this is what we called the 'current CPU capacity' in older
Android versions.

[...]

> @@ -260,26 +262,24 @@ static inline unsigned long em_cpu_energy(struct em_perf_domain *pd,
>  	/*
>  	 * In order to predict the performance state, map the utilization of
>  	 * the most utilized CPU of the performance domain to a requested 
> -	 * frequency, like schedutil. Take also into account that the real
> -	 * frequency might be set lower (due to thermal capping). Thus, clamp
> +	 * performance, like schedutil. Take also into account that the real
> +	 * performance might be set lower (due to thermal capping). Thus, clamp
>  	 * max utilization to the allowed CPU capacity before calculating
> -	 * effective frequency.
> +	 * effective performance.
>  	 */
>  	cpu = cpumask_first(to_cpumask(pd->cpus));
>  	scale_cpu = arch_scale_cpu_capacity(cpu);
> -	ref_freq = arch_scale_freq_ref(cpu);
>  
>  	max_util = map_util_perf(max_util);

Didn't apply cleanly on tip sched/code for me.

Looks like it's missing:

9c0b4bb7f630 - sched/cpufreq: Rework schedutil governor performance
estimation (2023-11-23 Vincent Guittot)

>  	max_util = min(max_util, allowed_cpu_cap);
> -	freq = map_util_freq(max_util, ref_freq, scale_cpu);

Since you're removing this here, shouldn't you also remove

* In order to predict the performance state, map the utilization of
* the most utilized CPU of the performance domain to a requested

Looks like with 9c0b4bb7f630 there is no mapping anymore?

[...]

>  static int em_compute_costs(struct device *dev, struct em_perf_state *table,
>  			    struct em_data_callback *cb, int nr_states,
>  			    unsigned long flags)
> @@ -318,6 +343,8 @@ static int em_create_perf_table(struct device *dev, struct em_perf_domain *pd,
>  		table[i].frequency = prev_freq = freq;
>  	}
>  
> +	em_init_performance(dev, pd, table, nr_states);

Looks like pd already has 'pd->nr_perf_states' initialized. so just
passing pd seems to be sufficient. Like for em_table_alloc() and
em_create_perf_table().

[...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ