* Re: [PATCH 1/3] thermal/cpu-cooling, sched/core: Cleanup thermal pressure definition
2020-06-14 1:07 ` [PATCH 1/3] thermal/cpu-cooling, sched/core: Cleanup thermal pressure definition Valentin Schneider
@ 2020-06-14 7:39 ` kernel test robot
2020-06-14 21:04 ` Valentin Schneider
2020-06-14 8:57 ` kernel test robot
` (2 subsequent siblings)
3 siblings, 1 reply; 12+ messages in thread
From: kernel test robot @ 2020-06-14 7:39 UTC (permalink / raw)
To: Valentin Schneider, linux-kernel, linux-arm-kernel, linux-pm
Cc: kbuild-all, Viresh Kumar, Amit Daniel Kachhap, Daniel Lezcano,
Russell King, Thara Gopinath, clang-built-linux, Sudeep Holla,
Ingo Molnar
[-- Attachment #1: Type: text/plain, Size: 2427 bytes --]
Hi Valentin,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on tip/auto-latest]
[also build test WARNING on driver-core/driver-core-testing tip/sched/core arm/for-next arm64/for-next/core soc/for-next linus/master v5.7 next-20200613]
[cannot apply to linux/master]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Valentin-Schneider/sched-arch_topology-Thermal-pressure-configuration-cleanup/20200614-091051
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 8dc697d75c13ee2901d1a40f1d7d58163048c204
config: arm64-randconfig-r013-20200614 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project cb5072d1877b38c972f95092db2cedbcddb81da6)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/base/arch_topology.c:59:6: warning: no previous prototype for function 'arch_set_thermal_pressure' [-Wmissing-prototypes]
void arch_set_thermal_pressure(const struct cpumask *cpus,
^
drivers/base/arch_topology.c:59:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void arch_set_thermal_pressure(const struct cpumask *cpus,
^
static
1 warning generated.
vim +/arch_set_thermal_pressure +59 drivers/base/arch_topology.c
58
> 59 void arch_set_thermal_pressure(const struct cpumask *cpus,
60 unsigned long th_pressure)
61 {
62 int cpu;
63
64 for_each_cpu(cpu, cpus)
65 WRITE_ONCE(per_cpu(thermal_pressure, cpu), th_pressure);
66 }
67
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 36464 bytes --]
[-- Attachment #3: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 1/3] thermal/cpu-cooling, sched/core: Cleanup thermal pressure definition
2020-06-14 7:39 ` kernel test robot
@ 2020-06-14 21:04 ` Valentin Schneider
0 siblings, 0 replies; 12+ messages in thread
From: Valentin Schneider @ 2020-06-14 21:04 UTC (permalink / raw)
To: kernel test robot
Cc: kbuild-all, linux-pm, Viresh Kumar, Amit Daniel Kachhap,
Daniel Lezcano, Russell King, Thara Gopinath, linux-kernel,
clang-built-linux, Sudeep Holla, Ingo Molnar, linux-arm-kernel
On 14/06/20 08:39, kernel test robot wrote:
> Hi Valentin,
>
> Thank you for the patch! Perhaps something to improve:
>
> [auto build test WARNING on tip/auto-latest]
> [also build test WARNING on driver-core/driver-core-testing tip/sched/core arm/for-next arm64/for-next/core soc/for-next linus/master v5.7 next-20200613]
> [cannot apply to linux/master]
> [if your patch is applied to the wrong git tree, please drop us a note to help
> improve the system. BTW, we also suggest to use '--base' option to specify the
> base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
>
> url: https://github.com/0day-ci/linux/commits/Valentin-Schneider/sched-arch_topology-Thermal-pressure-configuration-cleanup/20200614-091051
> base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 8dc697d75c13ee2901d1a40f1d7d58163048c204
> config: arm64-randconfig-r013-20200614 (attached as .config)
> compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project cb5072d1877b38c972f95092db2cedbcddb81da6)
> reproduce (this is a W=1 build):
Ah, W=1! I thought I was going nuts.
If desired, I can add a declaration in cpu_cooling.h, similar to what we
have for the arch_set_freq_scale() stub.
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # install arm64 cross compiling tool for clang build
> # apt-get install binutils-aarch64-linux-gnu
> # save the attached .config to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All warnings (new ones prefixed by >>, old ones prefixed by <<):
>
>>> drivers/base/arch_topology.c:59:6: warning: no previous prototype for function 'arch_set_thermal_pressure' [-Wmissing-prototypes]
> void arch_set_thermal_pressure(const struct cpumask *cpus,
> ^
> drivers/base/arch_topology.c:59:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
> void arch_set_thermal_pressure(const struct cpumask *cpus,
> ^
> static
> 1 warning generated.
>
> vim +/arch_set_thermal_pressure +59 drivers/base/arch_topology.c
>
> 58
> > 59 void arch_set_thermal_pressure(const struct cpumask *cpus,
> 60 unsigned long th_pressure)
> 61 {
> 62 int cpu;
> 63
> 64 for_each_cpu(cpu, cpus)
> 65 WRITE_ONCE(per_cpu(thermal_pressure, cpu), th_pressure);
> 66 }
> 67
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] thermal/cpu-cooling, sched/core: Cleanup thermal pressure definition
2020-06-14 1:07 ` [PATCH 1/3] thermal/cpu-cooling, sched/core: Cleanup thermal pressure definition Valentin Schneider
2020-06-14 7:39 ` kernel test robot
@ 2020-06-14 8:57 ` kernel test robot
2020-06-14 9:10 ` kernel test robot
2020-06-18 15:03 ` Vincent Guittot
3 siblings, 0 replies; 12+ messages in thread
From: kernel test robot @ 2020-06-14 8:57 UTC (permalink / raw)
To: Valentin Schneider, linux-kernel, linux-arm-kernel, linux-pm
Cc: kbuild-all, Viresh Kumar, Amit Daniel Kachhap, Daniel Lezcano,
Russell King, Thara Gopinath, Sudeep Holla, Ingo Molnar
[-- Attachment #1: Type: text/plain, Size: 2038 bytes --]
Hi Valentin,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on tip/auto-latest]
[also build test WARNING on driver-core/driver-core-testing tip/sched/core arm/for-next arm64/for-next/core soc/for-next linus/master v5.7 next-20200613]
[cannot apply to linux/master]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Valentin-Schneider/sched-arch_topology-Thermal-pressure-configuration-cleanup/20200614-091051
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 8dc697d75c13ee2901d1a40f1d7d58163048c204
config: riscv-allyesconfig (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/base/arch_topology.c:59:6: warning: no previous prototype for 'arch_set_thermal_pressure' [-Wmissing-prototypes]
59 | void arch_set_thermal_pressure(const struct cpumask *cpus,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
vim +/arch_set_thermal_pressure +59 drivers/base/arch_topology.c
58
> 59 void arch_set_thermal_pressure(const struct cpumask *cpus,
60 unsigned long th_pressure)
61 {
62 int cpu;
63
64 for_each_cpu(cpu, cpus)
65 WRITE_ONCE(per_cpu(thermal_pressure, cpu), th_pressure);
66 }
67
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 64515 bytes --]
[-- Attachment #3: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 1/3] thermal/cpu-cooling, sched/core: Cleanup thermal pressure definition
2020-06-14 1:07 ` [PATCH 1/3] thermal/cpu-cooling, sched/core: Cleanup thermal pressure definition Valentin Schneider
2020-06-14 7:39 ` kernel test robot
2020-06-14 8:57 ` kernel test robot
@ 2020-06-14 9:10 ` kernel test robot
2020-06-18 15:03 ` Vincent Guittot
3 siblings, 0 replies; 12+ messages in thread
From: kernel test robot @ 2020-06-14 9:10 UTC (permalink / raw)
To: Valentin Schneider, linux-kernel, linux-arm-kernel, linux-pm
Cc: kbuild-all, Viresh Kumar, Amit Daniel Kachhap, Daniel Lezcano,
Russell King, Thara Gopinath, Sudeep Holla, Ingo Molnar
[-- Attachment #1: Type: text/plain, Size: 1942 bytes --]
Hi Valentin,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on tip/auto-latest]
[also build test WARNING on driver-core/driver-core-testing tip/sched/core arm/for-next arm64/for-next/core soc/for-next linus/master v5.7 next-20200613]
[cannot apply to linux/master]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Valentin-Schneider/sched-arch_topology-Thermal-pressure-configuration-cleanup/20200614-091051
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 8dc697d75c13ee2901d1a40f1d7d58163048c204
config: sparc-allyesconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sparc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/thermal/cpufreq_cooling.c:421:1: warning: no previous prototype for 'arch_set_thermal_pressure' [-Wmissing-prototypes]
421 | arch_set_thermal_pressure(const struct cpumask *cpus, unsigned long th_pressure)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
vim +/arch_set_thermal_pressure +421 drivers/thermal/cpufreq_cooling.c
419
420 __weak void
> 421 arch_set_thermal_pressure(const struct cpumask *cpus, unsigned long th_pressure)
422 {
423 }
424
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 65591 bytes --]
[-- Attachment #3: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 1/3] thermal/cpu-cooling, sched/core: Cleanup thermal pressure definition
2020-06-14 1:07 ` [PATCH 1/3] thermal/cpu-cooling, sched/core: Cleanup thermal pressure definition Valentin Schneider
` (2 preceding siblings ...)
2020-06-14 9:10 ` kernel test robot
@ 2020-06-18 15:03 ` Vincent Guittot
2020-06-20 17:49 ` Ionela Voinescu
3 siblings, 1 reply; 12+ messages in thread
From: Vincent Guittot @ 2020-06-18 15:03 UTC (permalink / raw)
To: Valentin Schneider
Cc: Juri Lelli, open list:THERMAL, Peter Zijlstra, Viresh Kumar,
Amit Daniel Kachhap, Daniel Lezcano, Russell King, Thara Gopinath,
linux-kernel, Sudeep Holla, Dietmar Eggemann, Ingo Molnar, LAK
On Sun, 14 Jun 2020 at 03:10, Valentin Schneider
<valentin.schneider@arm.com> wrote:
>
> The following commit:
>
> 14533a16c46d ("thermal/cpu-cooling, sched/core: Move the arch_set_thermal_pressure() API to generic scheduler code")
>
> moved the definition of arch_set_thermal_pressure() to sched/core.c, but
> kept its declaration in linux/arch_topology.h. When building e.g. an x86
> kernel with CONFIG_SCHED_THERMAL_PRESSURE=y, cpufreq_cooling.c ends up
> getting the declaration of arch_set_thermal_pressure() from
> include/linux/arch_topology.h, which is somewhat awkward.
>
> On top of this, the public setter, arch_set_thermal_pressure(), is defined
> unconditionally in sched/core.c while the public getter,
> arch_scale_thermal_pressure(), is hardcoded to return 0 unless it has been
> redefined by the architecture. arch_*() functions are meant to be defined
> by architectures, so revert the aforementioned commit and re-implement it
> in a way that keeps arch_set_thermal_pressure() architecture-definable.
>
> Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
> ---
> drivers/base/arch_topology.c | 11 +++++++++++
> drivers/thermal/cpufreq_cooling.c | 5 +++++
> include/linux/arch_topology.h | 3 ---
> kernel/sched/core.c | 11 -----------
> 4 files changed, 16 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
> index 4d0a0038b476..d14cab7dfa3c 100644
> --- a/drivers/base/arch_topology.c
> +++ b/drivers/base/arch_topology.c
> @@ -54,6 +54,17 @@ void topology_set_cpu_scale(unsigned int cpu, unsigned long capacity)
> per_cpu(cpu_scale, cpu) = capacity;
> }
>
> +DEFINE_PER_CPU(unsigned long, thermal_pressure);
> +
> +void arch_set_thermal_pressure(const struct cpumask *cpus,
> + unsigned long th_pressure)
> +{
> + int cpu;
> +
> + for_each_cpu(cpu, cpus)
> + WRITE_ONCE(per_cpu(thermal_pressure, cpu), th_pressure);
> +}
> +
> static ssize_t cpu_capacity_show(struct device *dev,
> struct device_attribute *attr,
> char *buf)
> diff --git a/drivers/thermal/cpufreq_cooling.c b/drivers/thermal/cpufreq_cooling.c
> index e297e135c031..a1efd379b683 100644
> --- a/drivers/thermal/cpufreq_cooling.c
> +++ b/drivers/thermal/cpufreq_cooling.c
> @@ -417,6 +417,11 @@ static int cpufreq_get_cur_state(struct thermal_cooling_device *cdev,
> return 0;
> }
>
> +__weak void
> +arch_set_thermal_pressure(const struct cpumask *cpus, unsigned long th_pressure)
> +{
> +}
Having this weak function declared in cpufreq_cooling is weird. This
means that we will have to do so for each one that wants to use it.
Can't you declare an empty function in a common header file ?
> +
> /**
> * cpufreq_set_cur_state - callback function to set the current cooling state.
> * @cdev: thermal cooling device pointer.
> diff --git a/include/linux/arch_topology.h b/include/linux/arch_topology.h
> index 0566cb3314ef..81bd1c627195 100644
> --- a/include/linux/arch_topology.h
> +++ b/include/linux/arch_topology.h
> @@ -39,9 +39,6 @@ static inline unsigned long topology_get_thermal_pressure(int cpu)
> return per_cpu(thermal_pressure, cpu);
> }
>
> -void arch_set_thermal_pressure(struct cpumask *cpus,
> - unsigned long th_pressure);
> -
> struct cpu_topology {
> int thread_id;
> int core_id;
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 43ba2d4a8eca..7861d21f3c2b 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -3628,17 +3628,6 @@ unsigned long long task_sched_runtime(struct task_struct *p)
> return ns;
> }
>
> -DEFINE_PER_CPU(unsigned long, thermal_pressure);
> -
> -void arch_set_thermal_pressure(struct cpumask *cpus,
> - unsigned long th_pressure)
> -{
> - int cpu;
> -
> - for_each_cpu(cpu, cpus)
> - WRITE_ONCE(per_cpu(thermal_pressure, cpu), th_pressure);
> -}
> -
> /*
> * This function gets called by the timer code, with HZ frequency.
> * We call it with interrupts disabled.
> --
> 2.27.0
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 1/3] thermal/cpu-cooling, sched/core: Cleanup thermal pressure definition
2020-06-18 15:03 ` Vincent Guittot
@ 2020-06-20 17:49 ` Ionela Voinescu
[not found] ` <jhjmu4xcqyk.mognet@arm.com>
0 siblings, 1 reply; 12+ messages in thread
From: Ionela Voinescu @ 2020-06-20 17:49 UTC (permalink / raw)
To: Vincent Guittot
Cc: Juri Lelli, open list:THERMAL, Peter Zijlstra, Viresh Kumar,
Amit Daniel Kachhap, Daniel Lezcano, Russell King, Thara Gopinath,
linux-kernel, Ingo Molnar, LAK, Sudeep Holla, Valentin Schneider,
Dietmar Eggemann
Hi Vincent,
On Thursday 18 Jun 2020 at 17:03:24 (+0200), Vincent Guittot wrote:
> On Sun, 14 Jun 2020 at 03:10, Valentin Schneider
> <valentin.schneider@arm.com> wrote:
[..]
> > diff --git a/drivers/thermal/cpufreq_cooling.c b/drivers/thermal/cpufreq_cooling.c
> > index e297e135c031..a1efd379b683 100644
> > --- a/drivers/thermal/cpufreq_cooling.c
> > +++ b/drivers/thermal/cpufreq_cooling.c
> > @@ -417,6 +417,11 @@ static int cpufreq_get_cur_state(struct thermal_cooling_device *cdev,
> > return 0;
> > }
> >
> > +__weak void
> > +arch_set_thermal_pressure(const struct cpumask *cpus, unsigned long th_pressure)
> > +{
> > +}
>
> Having this weak function declared in cpufreq_cooling is weird. This
> means that we will have to do so for each one that wants to use it.
>
> Can't you declare an empty function in a common header file ?
Do we expect anyone other than cpufreq_cooling to call
arch_set_thermal_pressure()?
I'm not against any of the options, either having it here as a week
default definition (same as done for arch_set_freq_scale() in cpufreq.c)
or in a common header (as done for arch_scale_freq_capacity() in sched.h).
But for me, Valentin's implementation seems more natural as setters are
usually only called from within the framework that does the control
(throttling for thermal or frequency setting for cpufreq) and we
probably want to think twice if we want to call them from other places.
Thanks,
Ionela.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread