[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] platform/cpufreq: add public defines for CPUFREQ_SHARED_TYPE_


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 7 Apr 2022 11:35:20 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rqmnFV86czVWPs5sMKoEdYF2ER9xYGyCET3b2wi+2UQ=; b=PSGY/5Pvw49IHefmBswIhSDUW09fHdqqxGoYBByNR8/0EVVf4CwY8LtucXudb6So7X/rU8CzdGoTdPOYTiwH1CKIlJHcDhfqlgeGeem+iXNEiHy15cz9rYkFxJif5kurl3TLHEUpCtUmi2ip8ggLon7lSG28rM+Idklt5xIuDyNLX8MhvFBeOS0rof7ss4ktXZv/JBYQTYqhGgO30YdZe1EN0D8ADsbYPgmPSkuw9SGcRrfEK+2WH9gyOIvHO4UHJV/w827+COSnlrQ9ReyVu9ALiTMMKPuJOII4hbtzxsEs1ESlQ6ULnsSIZ7Fln+MzlL6wz3eo1zx0d8iayKKFLQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mYHxayyrfQ4L/YfUeCfszPjL12Ay4+LAhmDuE6CkJLtBOP8q55ew6nB7UUulQoBbUVYUK6D9WSiZUfHMZzRfnNtXKwvT0owe509spYU1b4SDkYqb/yjvcOsE9Ggs/Dj6PlDu7ZMeu33/SHEfCCgpBjynFhZF2Z3k6wynrkruyRVnLuFZ6pNRgS9vEIlwkKgvYavJP7K+KHqaEkhUd/DK5LUr8QqvmAIQiGvKK8G4QzkKvIkh26ObBs2WxA92fKfuJcDIcCyGryRyXcmT10L7UywHf1Rg91xsC1IQk2dF4+/jm7fCEEM0NQgzN16atM2xX+ccjxk4MH88zwt0OL5dsQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 07 Apr 2022 09:35:37 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 07.04.2022 11:22, Roger Pau Monné wrote:
> On Thu, Apr 07, 2022 at 10:48:50AM +0200, Jan Beulich wrote:
>> On 07.04.2022 10:18, Roger Pau Monne wrote:
>>> The values set in the shared_type field of xen_processor_performance
>>> have so far relied on Xen and Linux having the same
>>> CPUFREQ_SHARED_TYPE_ defines, as those have never been part of the
>>> public interface.
>>>
>>> Formalize by adding the defines for the allowed values in the public
>>> header, while renaming them to use the XEN_CPUPERF_SHARED_TYPE_ prefix
>>> for clarity.
>>>
>>> Set the Xen internal defines for CPUFREQ_SHARED_TYPE_ using the newly
>>> introduced XEN_CPUPERF_SHARED_TYPE_ public defines in order to avoid
>>> unnecessary code churn.  While there also drop
>>> CPUFREQ_SHARED_TYPE_NONE as it's unused.
>>>
>>> Fixes: 2fa7bee0a0 ('Get ACPI Px from dom0 and choose Px controller')
>>> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
>>
>> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
>> with one remark:
>>
>>> --- a/xen/include/acpi/cpufreq/cpufreq.h
>>> +++ b/xen/include/acpi/cpufreq/cpufreq.h
>>> @@ -78,10 +78,9 @@ DECLARE_PER_CPU(struct cpufreq_policy *, 
>>> cpufreq_cpu_policy);
>>>  extern int __cpufreq_set_policy(struct cpufreq_policy *data,
>>>                                  struct cpufreq_policy *policy);
>>>  
>>> -#define CPUFREQ_SHARED_TYPE_NONE (0) /* None */
>>
>> I realize this is unused, but do we really want/need to drop this?
>> I think it is used implicitly right now by assuming the value would
>> be zero; this could do with making explicit, in which case we'd
>> need the #define.
> 
> I don't think Xen uses it explicitly, all checks of shared_type are
> always against a specific CPUFREQ_SHARED_TYPE_{HW,ALL,ANY}.

Well, I said "implicitly"; if there was an explicit reference, you'd
have run into a build failure. But I did check now - all comparisons of
->shared_type are against explicit CPUFREQ_SHARED_TYPE_*. So I guess
dropping the value is fine.

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.