diff mbox series

[V12,1/7] x86: Drop CPU_SUP_INTEL from SCHED_MC_PRIO for the expansion.

Message ID 20231205063537.872834-2-li.meng@amd.com (mailing list archive)
State Accepted
Commit 3598e577d1290008dcc753a015675fe617cdde45
Headers show
Series amd-pstate preferred core | expand

Commit Message

Meng, Li (Jassmine) Dec. 5, 2023, 6:35 a.m. UTC
amd-pstate driver also uses SCHED_MC_PRIO, so decouple the requirement
of CPU_SUP_INTEL from the dependencies to allow compilation in kernels
without Intel CPU support.

Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Perry Yuan <perry.yuan@amd.com>
Signed-off-by: Meng Li <li.meng@amd.com>
---
 arch/x86/Kconfig | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Rafael J. Wysocki Dec. 12, 2023, 1:44 p.m. UTC | #1
On Tue, Dec 5, 2023 at 7:38 AM Meng Li <li.meng@amd.com> wrote:
>
> amd-pstate driver also uses SCHED_MC_PRIO, so decouple the requirement
> of CPU_SUP_INTEL from the dependencies to allow compilation in kernels
> without Intel CPU support.
>
> Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
> Reviewed-by: Huang Rui <ray.huang@amd.com>
> Reviewed-by: Perry Yuan <perry.yuan@amd.com>
> Signed-off-by: Meng Li <li.meng@amd.com>
> ---
>  arch/x86/Kconfig | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 3762f41bb092..3e57773f946a 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -1054,8 +1054,9 @@ config SCHED_MC
>
>  config SCHED_MC_PRIO
>         bool "CPU core priorities scheduler support"
> -       depends on SCHED_MC && CPU_SUP_INTEL
> -       select X86_INTEL_PSTATE
> +       depends on SCHED_MC
> +       select X86_INTEL_PSTATE if CPU_SUP_INTEL
> +       select X86_AMD_PSTATE if CPU_SUP_AMD && ACPI
>         select CPU_FREQ
>         default y
>         help
> --

This needs an ACK from the x86 maintainers.
Borislav Petkov Jan. 9, 2024, 10:45 a.m. UTC | #2
On Tue, Dec 05, 2023 at 02:35:31PM +0800, Meng Li wrote:
> amd-pstate driver also uses SCHED_MC_PRIO, so decouple the requirement
> of CPU_SUP_INTEL from the dependencies to allow compilation in kernels
> without Intel CPU support.
> 
> Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
> Reviewed-by: Huang Rui <ray.huang@amd.com>
> Reviewed-by: Perry Yuan <perry.yuan@amd.com>
> Signed-off-by: Meng Li <li.meng@amd.com>
> ---
>  arch/x86/Kconfig | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 3762f41bb092..3e57773f946a 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -1054,8 +1054,9 @@ config SCHED_MC
>  
>  config SCHED_MC_PRIO
>  	bool "CPU core priorities scheduler support"
> -	depends on SCHED_MC && CPU_SUP_INTEL
> -	select X86_INTEL_PSTATE
> +	depends on SCHED_MC
> +	select X86_INTEL_PSTATE if CPU_SUP_INTEL
> +	select X86_AMD_PSTATE if CPU_SUP_AMD && ACPI
>  	select CPU_FREQ
>  	default y
>  	help
> -- 

I was gonna ask why the selects but apparently mingo wants SCHED_MC_PRIO
to be selectable easier:

0a21fc1214a2 ("sched/x86: Make CONFIG_SCHED_MC_PRIO=y easier to enable")

So,

Acked-by: Borislav Petkov (AMD) <bp@alien8.de>

Thx.
Meng, Li (Jassmine) Jan. 10, 2024, 6:59 a.m. UTC | #3
[AMD Official Use Only - General]

Hi Petkov:

> -----Original Message-----
> From: Borislav Petkov <bp@alien8.de>
> Sent: Tuesday, January 9, 2024 6:45 PM
> To: Meng, Li (Jassmine) <Li.Meng@amd.com>
> Cc: Rafael J . Wysocki <rafael.j.wysocki@intel.com>; Huang, Ray
> <Ray.Huang@amd.com>; linux-pm@vger.kernel.org; linux-
> kernel@vger.kernel.org; x86@kernel.org; linux-acpi@vger.kernel.org; Shuah
> Khan <skhan@linuxfoundation.org>; linux-kselftest@vger.kernel.org;
> Fontenot, Nathan <Nathan.Fontenot@amd.com>; Sharma, Deepak
> <Deepak.Sharma@amd.com>; Deucher, Alexander
> <Alexander.Deucher@amd.com>; Limonciello, Mario
> <Mario.Limonciello@amd.com>; Huang, Shimmer
> <Shimmer.Huang@amd.com>; Yuan, Perry <Perry.Yuan@amd.com>; Du,
> Xiaojian <Xiaojian.Du@amd.com>; Viresh Kumar <viresh.kumar@linaro.org>;
> Oleksandr Natalenko <oleksandr@natalenko.name>
> Subject: Re: [PATCH V12 1/7] x86: Drop CPU_SUP_INTEL from
> SCHED_MC_PRIO for the expansion.
>
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
>
>
> On Tue, Dec 05, 2023 at 02:35:31PM +0800, Meng Li wrote:
> > amd-pstate driver also uses SCHED_MC_PRIO, so decouple the
> requirement
> > of CPU_SUP_INTEL from the dependencies to allow compilation in kernels
> > without Intel CPU support.
> >
> > Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
> > Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
> > Reviewed-by: Huang Rui <ray.huang@amd.com>
> > Reviewed-by: Perry Yuan <perry.yuan@amd.com>
> > Signed-off-by: Meng Li <li.meng@amd.com>
> > ---
> >  arch/x86/Kconfig | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index
> > 3762f41bb092..3e57773f946a 100644
> > --- a/arch/x86/Kconfig
> > +++ b/arch/x86/Kconfig
> > @@ -1054,8 +1054,9 @@ config SCHED_MC
> >
> >  config SCHED_MC_PRIO
> >       bool "CPU core priorities scheduler support"
> > -     depends on SCHED_MC && CPU_SUP_INTEL
> > -     select X86_INTEL_PSTATE
> > +     depends on SCHED_MC
> > +     select X86_INTEL_PSTATE if CPU_SUP_INTEL
> > +     select X86_AMD_PSTATE if CPU_SUP_AMD && ACPI
> >       select CPU_FREQ
> >       default y
> >       help
> > --
>
> I was gonna ask why the selects but apparently mingo wants
> SCHED_MC_PRIO to be selectable easier:
>
> 0a21fc1214a2 ("sched/x86: Make CONFIG_SCHED_MC_PRIO=y easier to
> enable")
>
[Meng, Li (Jassmine)] Thank you for your feedback.
The reason why I added the selects is just to distinguish different pstate drivers.
These two drivers cannot be supported simultaneously in the same project.
> So,
>
> Acked-by: Borislav Petkov (AMD) <bp@alien8.de>
>
> Thx.
>
> --
> Regards/Gruss,
>     Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette
Borislav Petkov Jan. 10, 2024, 10:04 a.m. UTC | #4
On Wed, Jan 10, 2024 at 06:59:25AM +0000, Meng, Li (Jassmine) wrote:
> The reason why I added the selects is just to distinguish different
> pstate drivers.  These two drivers cannot be supported simultaneously
> in the same project.

No, that's not what I meant. Read here:

"- reverse dependencies: "select" <symbol> ["if" <expr>]

  While normal dependencies reduce the upper limit of a symbol (see
  below), reverse dependencies can be used to force a lower limit of
  another symbol. The value of the current menu symbol is used as the
  minimal value <symbol> can be set to. If <symbol> is selected multiple
  times, the limit is set to the largest selection.
  Reverse dependencies can only be used with boolean or tristate
  symbols.

  Note:
        select should be used with care. select will force
        a symbol to a value without visiting the dependencies.
        By abusing select you are able to select a symbol FOO even
        if FOO depends on BAR that is not set.
        In general use select only for non-visible symbols
        (no prompts anywhere) and for symbols with no dependencies.
        That will limit the usefulness but on the other hand avoid
        the illegal configurations all over."

From Documentation/kbuild/kconfig-language.rst
Meng, Li (Jassmine) Jan. 11, 2024, 8:10 a.m. UTC | #5
[AMD Official Use Only - General]

Hi Petkov:

> -----Original Message-----
> From: Borislav Petkov <bp@alien8.de>
> Sent: Wednesday, January 10, 2024 6:04 PM
> To: Meng, Li (Jassmine) <Li.Meng@amd.com>
> Cc: Rafael J . Wysocki <rafael.j.wysocki@intel.com>; Huang, Ray
> <Ray.Huang@amd.com>; linux-pm@vger.kernel.org; linux-
> kernel@vger.kernel.org; x86@kernel.org; linux-acpi@vger.kernel.org; Shuah
> Khan <skhan@linuxfoundation.org>; linux-kselftest@vger.kernel.org;
> Fontenot, Nathan <Nathan.Fontenot@amd.com>; Sharma, Deepak
> <Deepak.Sharma@amd.com>; Deucher, Alexander
> <Alexander.Deucher@amd.com>; Limonciello, Mario
> <Mario.Limonciello@amd.com>; Huang, Shimmer
> <Shimmer.Huang@amd.com>; Yuan, Perry <Perry.Yuan@amd.com>; Du,
> Xiaojian <Xiaojian.Du@amd.com>; Viresh Kumar <viresh.kumar@linaro.org>;
> Oleksandr Natalenko <oleksandr@natalenko.name>
> Subject: Re: [PATCH V12 1/7] x86: Drop CPU_SUP_INTEL from
> SCHED_MC_PRIO for the expansion.
>
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
>
>
> On Wed, Jan 10, 2024 at 06:59:25AM +0000, Meng, Li (Jassmine) wrote:
> > The reason why I added the selects is just to distinguish different
> > pstate drivers.  These two drivers cannot be supported simultaneously
> > in the same project.
>
> No, that's not what I meant. Read here:
>
> "- reverse dependencies: "select" <symbol> ["if" <expr>]
>
>   While normal dependencies reduce the upper limit of a symbol (see
>   below), reverse dependencies can be used to force a lower limit of
>   another symbol. The value of the current menu symbol is used as the
>   minimal value <symbol> can be set to. If <symbol> is selected multiple
>   times, the limit is set to the largest selection.
>   Reverse dependencies can only be used with boolean or tristate
>   symbols.
>
>   Note:
>         select should be used with care. select will force
>         a symbol to a value without visiting the dependencies.
>         By abusing select you are able to select a symbol FOO even
>         if FOO depends on BAR that is not set.
>         In general use select only for non-visible symbols
>         (no prompts anywhere) and for symbols with no dependencies.
>         That will limit the usefulness but on the other hand avoid
>         the illegal configurations all over."
>
> From Documentation/kbuild/kconfig-language.rst
>
[Meng, Li (Jassmine)] Thanks a lot.
I will modify it soon.

> --
> Regards/Gruss,
>     Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette
Borislav Petkov Jan. 11, 2024, 9:19 a.m. UTC | #6
On Thu, Jan 11, 2024 at 08:10:48AM +0000, Meng, Li (Jassmine) wrote:
> I will modify it soon.

No, don't modify it, don't do anything. Please read the whole thread
again.
diff mbox series

Patch

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 3762f41bb092..3e57773f946a 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1054,8 +1054,9 @@  config SCHED_MC
 
 config SCHED_MC_PRIO
 	bool "CPU core priorities scheduler support"
-	depends on SCHED_MC && CPU_SUP_INTEL
-	select X86_INTEL_PSTATE
+	depends on SCHED_MC
+	select X86_INTEL_PSTATE if CPU_SUP_INTEL
+	select X86_AMD_PSTATE if CPU_SUP_AMD && ACPI
 	select CPU_FREQ
 	default y
 	help