diff mbox series

[v6,2/7] sched: Add hook to read per cpu thermal pressure.

Message ID 1576123908-12105-3-git-send-email-thara.gopinath@linaro.org
State New
Headers show
Series Introduce Thermal Pressure | expand

Commit Message

Thara Gopinath Dec. 12, 2019, 4:11 a.m. UTC
Introduce arch_scale_thermal_capacity to retrieve per cpu thermal
pressure.

Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>

---
 include/linux/sched/topology.h | 8 ++++++++
 1 file changed, 8 insertions(+)

-- 
2.1.4

Comments

Peter Zijlstra Dec. 16, 2019, 2:35 p.m. UTC | #1
On Wed, Dec 11, 2019 at 11:11:43PM -0500, Thara Gopinath wrote:
> Introduce arch_scale_thermal_capacity to retrieve per cpu thermal

> pressure.

> 

> Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>

> ---

>  include/linux/sched/topology.h | 8 ++++++++

>  1 file changed, 8 insertions(+)

> 

> diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h

> index f341163..f1e22f9 100644

> --- a/include/linux/sched/topology.h

> +++ b/include/linux/sched/topology.h

> @@ -225,6 +225,14 @@ unsigned long arch_scale_cpu_capacity(int cpu)

>  }

>  #endif

>  

> +#ifndef arch_scale_thermal_capacity

> +static __always_inline

> +unsigned long arch_scale_thermal_capacity(int cpu)

> +{

> +	return 0;

> +}

> +#endif


This is confusing, the return value is not a capacity, it is a reduction
in capacity. Either a comment of a better name would be appreciated.
Dietmar Eggemann Dec. 17, 2019, 12:54 p.m. UTC | #2
On 16/12/2019 15:35, Peter Zijlstra wrote:
> On Wed, Dec 11, 2019 at 11:11:43PM -0500, Thara Gopinath wrote:


minor: in subject: s/sched/sched/topology


>> Introduce arch_scale_thermal_capacity to retrieve per cpu thermal

>> pressure.

>>

>> Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>

>> ---

>>  include/linux/sched/topology.h | 8 ++++++++

>>  1 file changed, 8 insertions(+)

>>

>> diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h

>> index f341163..f1e22f9 100644

>> --- a/include/linux/sched/topology.h

>> +++ b/include/linux/sched/topology.h

>> @@ -225,6 +225,14 @@ unsigned long arch_scale_cpu_capacity(int cpu)

>>  }

>>  #endif

>>  

>> +#ifndef arch_scale_thermal_capacity

>> +static __always_inline

>> +unsigned long arch_scale_thermal_capacity(int cpu)

>> +{

>> +	return 0;

>> +}

>> +#endif

> 

> This is confusing, the return value is not a capacity, it is a reduction

> in capacity. Either a comment of a better name would be appreciated.


+1, the patch-set uses: thermal_capacity, thermal_pressure,
capped_capacity.
diff mbox series

Patch

diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h
index f341163..f1e22f9 100644
--- a/include/linux/sched/topology.h
+++ b/include/linux/sched/topology.h
@@ -225,6 +225,14 @@  unsigned long arch_scale_cpu_capacity(int cpu)
 }
 #endif
 
+#ifndef arch_scale_thermal_capacity
+static __always_inline
+unsigned long arch_scale_thermal_capacity(int cpu)
+{
+	return 0;
+}
+#endif
+
 static inline int task_node(const struct task_struct *p)
 {
 	return cpu_to_node(task_cpu(p));