lkml.org 
[lkml]   [2021]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 15/19] cpupower: add amd-pstate sysfs entries into libcpufreq
On Fri, Sep 10, 2021 at 06:26:06AM +0800, Shuah Khan wrote:
> On 9/8/21 8:59 AM, Huang Rui wrote:
> > These amd-pstate sysfs entries will be used on cpupower for amd-pstate
> > kernel module.
> >
>
> This commit log doesn't make sense. If these sysfs entries are used
> for amd-pstate kernel module, why are they defined here.
>
> Describe how these are used and the relationship between these defines
> and the amd-pstate kernel module
>
> > Signed-off-by: Huang Rui <ray.huang@amd.com>
> > ---
> > tools/power/cpupower/lib/cpufreq.c | 18 +++++++++++++++++-
> > 1 file changed, 17 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/power/cpupower/lib/cpufreq.c b/tools/power/cpupower/lib/cpufreq.c
> > index c3b56db8b921..3f92ddadaad2 100644
> > --- a/tools/power/cpupower/lib/cpufreq.c
> > +++ b/tools/power/cpupower/lib/cpufreq.c
> > @@ -69,6 +69,14 @@ enum cpufreq_value {
> > SCALING_MIN_FREQ,
> > SCALING_MAX_FREQ,
> > STATS_NUM_TRANSITIONS,
> > + AMD_PSTATE_HIGHEST_PERF,
> > + AMD_PSTATE_NOMINAL_PERF,
> > + AMD_PSTATE_LOWEST_NONLINEAR_PERF,
> > + AMD_PSTATE_LOWEST_PERF,
> > + AMD_PSTATE_MAX_FREQ,
> > + AMD_PSTATE_NOMINAL_FREQ,
> > + AMD_PSTATE_LOWEST_NONLINEAR_FREQ,
> > + AMD_PSTATE_MIN_FREQ,
> > MAX_CPUFREQ_VALUE_READ_FILES
> > };
> >
>
> These are AMD specific values being added to a common code.
>
> > @@ -80,7 +88,15 @@ static const char *cpufreq_value_files[MAX_CPUFREQ_VALUE_READ_FILES] = {
> > [SCALING_CUR_FREQ] = "scaling_cur_freq",
> > [SCALING_MIN_FREQ] = "scaling_min_freq",
> > [SCALING_MAX_FREQ] = "scaling_max_freq",
> > - [STATS_NUM_TRANSITIONS] = "stats/total_trans"
> > + [STATS_NUM_TRANSITIONS] = "stats/total_trans",
> > + [AMD_PSTATE_HIGHEST_PERF] = "amd_pstate_highest_perf",
> > + [AMD_PSTATE_NOMINAL_PERF] = "amd_pstate_nominal_perf",
> > + [AMD_PSTATE_LOWEST_NONLINEAR_PERF] = "amd_pstate_lowest_nonlinear_perf",
> > + [AMD_PSTATE_LOWEST_PERF] = "amd_pstate_lowest_perf",
> > + [AMD_PSTATE_MAX_FREQ] = "amd_pstate_max_freq",
> > + [AMD_PSTATE_NOMINAL_FREQ] = "amd_pstate_nominal_freq",
> > + [AMD_PSTATE_LOWEST_NONLINEAR_FREQ] = "amd_pstate_lowest_nonlinear_freq",
> > + [AMD_PSTATE_MIN_FREQ] = "amd_pstate_min_freq"
> > };
> >
> >
> >
>
> These are AMD specific values being added to a common code.
> It doesn't sound right. What happens if there is a conflict
> between AMD values and another vendor values?
>
> This doesn't seem a good place to add these.
>

Shuah, thanks for your suggestion, I went through the cpupower patches
again. And yes, we should not combine the amd specific and common things
together.

Could I expose a simliar sysfs_cpufreq_get_one_value in cpupower_intern.h
header, and move amd_pstate_* function implementation into
utils/helpers/amd.c? It can keep the lib/cpufreq still general.

Thanks,
Ray

\
 
 \ /
  Last update: 2021-09-16 10:48    [W:0.148 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site