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

Re: [PATCH] xen/cpufreq: Reset policy after enabling/disabling turbo status


  • To: Jane Malalane <jane.malalane@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 10 Nov 2021 13:39:21 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=4qpKMFy4TRoXc7OmV+alw9lchQ6vvvfRn9NoZznXQYM=; b=HBsPOTLnI/cczcRH/cLuQ8qrSeq96gQ6FwhcdPCAz3VGSbbgoUAnXiCaA/jJNxQpnTW9lXrWZ1+l6qXhP1JA/4NZ8Os4E+Jv+TCnrpmNFVLWMU9PgX7MxlymrbzU+qaGiihHNZhxmK+zweCvlqBukYHykP9AyyOelszfHxi52W3jyjLG/fTOZ6P2byfYIx9qOPPQGaNARAn4r99AiGGlpI+uM2PEc2+KxSOmOMRfwvCgIpYQzYEqEnXCFjPwXkIr8z3FwXDx6+1qkUeQYv0VsIjqyX56IjkjRAhgjaeslrw6oiukDbrPx6puBK1i5j/ffziKkvEY0AlwFtbX6wo3bA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IqroA3bcR9adQx5wV2uoCA3s6/Dc/PT/O/kIJ3RUxd7aT1zqjbtzZiS4ZinirxKfgkRG6+ZpEXS93PuYmxwMdj0yGa4oIpllSzGwDkgsCyrg2yRUgxbioLo9QQvLbcHvTr+D4nXEt0/ArMYkl81UMLuwr5CDVikBUADn3+h8cqGRniDwnQX7Z2LOTvcovUUh8aQ9K0DBqoXeKUacaqmQRxsw7eKqJTHC+FC2PDx8auB0fwQVR+3n7sroCzbhN1gXzvqaHLhlvwf153Nax8gZLO14zNMRWCE5EcOKiBvq1Yf9Jv9o5Jm7q3BcCiVQQYiUItbUiYse3vMes+wPzBJNBA==
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>
  • Delivery-date: Wed, 10 Nov 2021 12:40:09 +0000
  • Ironport-data: A9a23:W7unvaldln9e5N1znf1A+T7o5gxgIURdPkR7XQ2eYbSJt1+Wr1Gzt xJOCjiAM//fY2D3e9BwOou2oxgFu8TTnIJhHFc+/yk0QyMWpZLJC+rCIxarNUt+DCFioGGLT Sk6QoOdRCzhZiaE/n9BClVlxJVF/fngqoDUUYYoAQgsA187IMsdoUg7wbdg29cw2YLR7z6l4 rseneWOYDdJ5BYsWo4kw/rrRMRH5amaVJsw5zTSVNgT1LPsvyB94KE3fMldG0DQUIhMdtNWc s6YpF2PEsE1yD92Yj+tuu6TnkTn2dc+NyDW4pZdc/DKbhSvOkXee0v0XRYRQR4/ttmHozx+4 MV3rreQYl52ApSSsbhFUjwGCHxBMLITrdcrIVDn2SCS50jPcn+qyPRyFkAme4Yf/46bA0kXq 6ZecmpUKEne2aTmm9pXScE17ignBNPsM44F/Glp0BnSDOo8QICFSKLPjTNd9Gpv25oSTK6HD yYfQX1gYxucPDxCAAcsKakZpv713GDTdQQN/Tp5ooJoujOOnWSdyoPFMcXXUsyHQ91PmUSVr X6A+H72ajkYPtGCzTuO8lq3m/TC2yj8Xeo6BLC+s/JnnlCX7mgSEwENE0u2p+GjjUyzUM4ZL FYbkhfCtoBrqhbtFIOkGUTl/jjU5XbwRua8DcUq0hqm6oGNvDqgWEFYFj9kNsd7i8IpEGlCO k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SS7/yKmTVQeuxIqLLskNHK9JbjJjVWPHlXgslbnnhE422gYytLrWd9dP4E/M 323Ls6m9PsQwVdUu2LQl0+G8TTrdzCk5zrJTYAGh4c8QGLyRel8qTzHRS01goXF2on+8ZuzU H11yjCoomzufCyzRHRk0fV8pRtgdPkjv9OHtaFhMQ5IijlziyoeINicbufuy1dmpDk1H8a1P 335zswNcV67H3cOkmzvBvWwgHllA0j7nfzoGXo90fLkIjcfnYXGsBBjYVWfl/y8Ew7puxx16 pNwiawq4dXJQmoplWy2/H4EzVR0makq3srluAey1ZFV5EFVbNXpYsDuGtIDZY7Gj7g4oxPKp ggMCjl3ocXTbqmVQGbgoE2q+bcHEjbXy32DnTqg/blkgS/xxtCvg4lLM92pAZ2yHtycegB2w 3+CNUaqFh5dL5jUUtMPpZwfSKJMB2+ffvtChPaHb21LtBOB5ryw6SHlYndotvaP6A18A==
  • Ironport-sdr: +lJUA+s/PftXbE2U5KIMmpiL9pUpLRBmzbfdrJ4yJbVbCUQ0onr/p1Uwszh05rCviLWgnklCOn 8HHnTpHuFO9fdLBG86vf4/ve8mI51/d8sI2j85vyaP5o+ffAMtC3TkwViQ3vWJVi36876VYZjS BW6wJuyveBUhYc/vBY5EEGEDGJZHGadUQSULJUKJjkgEh7NGJ6nHI9n2nKI2PxgWb11Ixnnwxr iKJxMeeWLIrexvDxRKoiBXm6ipXqqEWM8tW1Kn59Wr7ovTR/rVTjF42eZcJlCzbMSU6CoSxTRK uwMbF0j5ahRJGICHqokTAf7N
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Nov 10, 2021 at 09:19:35AM +0000, Jane Malalane wrote:
> Before, user would change turbo status but this had no effect: boolean
> was set but policy wasn't reevaluated.  Policy must be reevaluated so
> that CPU frequency is chosen according to the turbo status and the
> current governor.
> 
> Therefore, add __cpufreq_governor() in cpufreq_update_turbo().
> 
> Reported-by: <edvin.torok@xxxxxxxxxx>
> Signed-off-by: <jane.malalane@xxxxxxxxxx>
> ---
> CC: Jan Beulich <jbeulich@xxxxxxxx>
> CC: Ian Jackson <iwj@xxxxxxxxxxxxxx>
> ---
> 
> Release rationale:
> Not taking this patch means that turbo status is misleading.
> 
> Taking this patch is low-risk as it only uses a function that already
> exists and is already used for setting the chosen scaling governor.
> Essentially, this change is equivalent to running 'xenpm
> en/disable-turbo-mode' and, subsequently, running 'xenpm
> set-scaling-governor <current governor>'.
> ---
>  xen/drivers/cpufreq/utility.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/drivers/cpufreq/utility.c b/xen/drivers/cpufreq/utility.c
> index b93895d4dd..5f200ff3ee 100644
> --- a/xen/drivers/cpufreq/utility.c
> +++ b/xen/drivers/cpufreq/utility.c
> @@ -417,10 +417,14 @@ int cpufreq_update_turbo(int cpuid, int new_state)
>      {
>          ret = cpufreq_driver.update(cpuid, policy);
>          if (ret)
> +        {
>              policy->turbo = curr_state;
> +            return ret;
> +        }
>      }
>  
> -    return ret;
> +    /* Reevaluate current CPU policy. */
> +    return __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);

Do you need to revert the policy->turbo value to the previous one if
the call to __cpufreq_governor returns an error? (much like it's done
for the .update call above).

Thanks, Roger.



 


Rackspace

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