|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v2] x86/cpufreq: Add Kconfig option for CPU frequency scaling
On 10.02.2026 03:04, Stefano Stabellini wrote:
> On Mon, 9 Feb 2026, Jan Beulich wrote:
>> On 07.02.2026 00:30, Stefano Stabellini wrote:> --- a/xen/common/Kconfig
>>> --- a/xen/include/xen/sched.h
>>> +++ b/xen/include/xen/sched.h
>>> @@ -1255,9 +1255,14 @@ static always_inline bool is_iommu_enabled(const
>>> struct domain *d)
>>> extern bool sched_smt_power_savings;
>>> extern bool sched_disable_smt_switching;
>>>
>>> -extern enum cpufreq_controller {
>>> +enum cpufreq_controller {
>>> FREQCTL_none, FREQCTL_dom0_kernel, FREQCTL_xen
>>> -} cpufreq_controller;
>>
>> This enum would better ...
>>
>>> +};
>>> +#ifdef CONFIG_CPUFREQ
>>> +extern enum cpufreq_controller cpufreq_controller;
>>
>> ... stay inside here, then also making the split of type and var decl
>> unnecessary.
>>
>> The two affected platform-ops likely want compiling out, too.
>
> I am not sure I understood your suggestion. If this is what you are
> thinking about, it doesn't seem like an improvement.
>
> --- a/xen/include/xen/sched.h
> +++ b/xen/include/xen/sched.h
> @@ -1255,13 +1255,15 @@ static always_inline bool is_iommu_enabled(const
> struct domain *d)
> extern bool sched_smt_power_savings;
> extern bool sched_disable_smt_switching;
>
> +#ifdef CONFIG_CPUFREQ
> enum cpufreq_controller {
> FREQCTL_none, FREQCTL_dom0_kernel, FREQCTL_xen
> };
> -#ifdef CONFIG_CPUFREQ
> extern enum cpufreq_controller cpufreq_controller;
> #else
> -#define cpufreq_controller FREQCTL_none
> +#define FREQCTL_none 0
> +#define FREQCTL_dom0_kernel 1
> +#define cpufreq_controller FREQCTL_none
> #endif
No. FREQCTL_* shouldn't need to be visible at all when CPUFREQ=n. Hence
the reference to the two platform-ops, where one (and cpufreq_controller)
is used. If those uses are also suitably compiled out, the #define-s
above shouldn't be necessary. That said, use of IS_ENABLED() there would
of course require the arrangement to stay as you had it originally.
Jan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |