All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Ian Jackson <iwj@xenproject.org>,
	Jane Malalane <jane.malalane@citrix.com>
Subject: Re: [PATCH] xen/cpufreq: Reset policy after enabling/disabling turbo status
Date: Thu, 11 Nov 2021 12:06:40 +0100	[thread overview]
Message-ID: <2d16eb78-4438-924e-f873-114849dbc8de@suse.com> (raw)
In-Reply-To: <YYu9eYxIYs5gol5q@Air-de-Roger>

On 10.11.2021 13:39, Roger Pau Monné wrote:
> On Wed, Nov 10, 2021 at 09:19:35AM +0000, Jane Malalane wrote:
>> --- 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).

I guess this can be viewed either way: Keeping the value would allow
a later successful invocation of the .target() hook to observe the
intended value. Obviously then it's questionable whether returning an
error in that case isn't going to be misleading - failure of the
policy update would then rather need to be indicated by some
"deferred" indicator (which we don't have). Taking into account the
behavior prior to this patch I wonder whether it's an option to
simply ignore an error from __cpufreq_governor() here.

Jan



  reply	other threads:[~2021-11-11 11:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-10  9:19 [PATCH] xen/cpufreq: Reset policy after enabling/disabling turbo status Jane Malalane
2021-11-10 11:48 ` Ian Jackson
2021-11-12 11:31   ` Jane Malalane
2021-11-10 12:39 ` Roger Pau Monné
2021-11-11 11:06   ` Jan Beulich [this message]
2021-11-11 11:00 ` Jan Beulich
2021-11-12 18:51 ` Andrew Cooper
2021-11-12 19:51   ` Jason Andryuk
2021-11-15 10:53   ` Jan Beulich
2021-11-15 14:33     ` Andrew Cooper
2021-11-15 16:21       ` Jan Beulich
2021-11-15 22:05         ` Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2d16eb78-4438-924e-f873-114849dbc8de@suse.com \
    --to=jbeulich@suse.com \
    --cc=iwj@xenproject.org \
    --cc=jane.malalane@citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.