All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Vincent Donnefort <vincent.donnefort@arm.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	Lukasz Luba <lukasz.luba@arm.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Quentin Perret <qperret@google.com>,
	Linux PM <linux-pm@vger.kernel.org>,
	Ionela Voinescu <ionela.voinescu@arm.com>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>
Subject: Re: [PATCH v3 3/6] cpufreq: Add an interface to mark inefficient frequencies
Date: Tue, 6 Jul 2021 14:11:24 +0200	[thread overview]
Message-ID: <CAJZ5v0h+zZZOn70eGD9XZy0rcy0ic-C1=UC7YGLhUahVgC4pzg@mail.gmail.com> (raw)
In-Reply-To: <20210706081256.GA216826@e120877-lin.cambridge.arm.com>

On Tue, Jul 6, 2021 at 10:13 AM Vincent Donnefort
<vincent.donnefort@arm.com> wrote:
>
> [...]
>
> > >
> > > What about a cpufreq_policy option that if sets would make
> > > cpufreq_frequency_table_target() skip inefficient OPPs while staying within
> > > the limit of max policy?
> >
> > That would work too, ->
> >
> > > Each governor could decide to set it or not, but
> > > it would hide the efficiency resolution to the governor and allow drivers
> > > that implements ->target() to also implements support for inefficient OPPs.
> >
> > -> but alternatively there could be an additional cpufreq driver flag
> > to be set by the drivers implementing ->target() and wanting to deal
> > with CPUFREQ_RELATION_EFFICIENT themselves (an opt-in of sorts).
> >
> > So the governors that want it may pass CPUFREQ_RELATION_EFFICIENT to
> > __cpufreq_driver_target() and then it will be passed to ->target()
> > depending on whether or not the new driver flag is set.
>
> Of course, I can implement this instead of a cpufreq_policy flag in v4.
> I suppose then right fallback for CPUFREQ_RELATION_EFFICIENT in case the
> driver doesn't opt-in is CPUFREQ_RELATION_L.
>
> >
> > > That flag could be set according to a new cpufreq_governor flag
> > > CPUFREQ_GOV_SKIP_INEFFICIENCIES?
> > >
> > > That could though modify behaviors like powersave_bias from ondemand. But if
> > > a frequency is inefficient, there's probably no power saving anyway.
> >
> > AFAICS, the userspace governor aside, using inefficient frequencies
> > only works with the powersave governor.  In the other cases,
> > RELATION_L (say) can be interpreted as "the closest efficient
> > frequency equal to or above the target" with the max policy limit
> > possibly causing inefficient frequencies to be used if they are closer
> > to the limit than the next efficient one.
> >
> > As a rule, the governors don't assume that there are any inefficient
> > frequencies in the table.  In fact, they don't make any assumptions
> > regarding the contents of the frequency table at all.  They don't even
> > assume that the driver uses a frequency table in the first place.
>
> So all the governors, beside powersave and userspace would replace their
> RELATION_L with RELATION_EFFICIENT. I'll add the changes in v4.
>
> So if I sum-up: new RELATION_EFFICIENT that resolves RELATION_L to an higher
> efficient frequency (if necessary) within the limits of policy->max.

Yes.

It can be called RELATION_E for brevity.

> CPUfreq drivers can opt-in by setting an appropriate flag. If they do not,
> RELATION_EFFICIENT will be rewritten in RELATION_L.

Yes, and cpufreq_frequency_table_target() will take RELATION_E into
account if set.

> All governors but userspace and powersave would use RELATION_EFFICIENT instead of RELATION_L.

Yes.

> If that works for you, I'll implement this in a v4, as well as some
> improvements for the CPUfreq/EM registration following the discussion with
> Viresh.

Sounds good, thanks!

  parent reply	other threads:[~2021-07-06 12:35 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-04 11:05 [PATCH v3 0/6] EM / PM: Inefficient OPPs Vincent Donnefort
2021-06-04 11:05 ` [PATCH v3 1/6] PM / EM: Fix inefficient states detection Vincent Donnefort
2021-06-04 18:09   ` Matthias Kaehlcke
2021-06-04 11:05 ` [PATCH v3 2/6] PM / EM: Mark inefficient states Vincent Donnefort
2021-06-04 18:12   ` Matthias Kaehlcke
2021-06-04 11:05 ` [PATCH v3 3/6] cpufreq: Add an interface to mark inefficient frequencies Vincent Donnefort
2021-06-04 18:19   ` Matthias Kaehlcke
2021-06-14 13:40     ` Vincent Donnefort
2021-06-07  5:02   ` Viresh Kumar
2021-06-07 10:14     ` Lukasz Luba
2021-06-14  7:28   ` Viresh Kumar
2021-06-14 13:35     ` Vincent Donnefort
2021-06-15  5:02       ` Viresh Kumar
2021-06-15  8:44         ` Vincent Donnefort
2021-06-15 10:17           ` Viresh Kumar
2021-06-15 17:15             ` Vincent Donnefort
2021-06-16  7:35               ` Viresh Kumar
2021-06-16  9:03                 ` Lukasz Luba
2021-06-16  9:31                   ` Viresh Kumar
2021-06-16 10:33                     ` Lukasz Luba
2021-06-16 10:53                       ` Viresh Kumar
2021-06-16 12:45                         ` Lukasz Luba
2021-07-02 14:21                           ` Lukasz Luba
2021-07-02 15:46                             ` Rafael J. Wysocki
2021-07-02 16:04                               ` Rafael J. Wysocki
2021-07-02 16:08                                 ` Lukasz Luba
2021-07-02 17:53                                   ` Rafael J. Wysocki
2021-07-02 19:04                                     ` Lukasz Luba
2021-07-02 19:17                                     ` Vincent Donnefort
2021-07-05 14:09                                       ` Rafael J. Wysocki
2021-07-06  8:12                                         ` Vincent Donnefort
2021-07-06  8:37                                           ` Viresh Kumar
2021-07-06  8:43                                             ` Vincent Donnefort
2021-07-06  8:50                                               ` Viresh Kumar
2021-07-06 12:11                                           ` Rafael J. Wysocki [this message]
2021-07-02 16:13                               ` Vincent Donnefort
2021-07-02 17:38                                 ` Rafael J. Wysocki
2021-06-22  9:01             ` Quentin Perret
2021-06-22  9:25               ` Viresh Kumar
2021-06-04 11:05 ` [PATCH v3 4/6] cpufreq: Skip inefficient frequencies in cpufreq_driver_resolve_freq() Vincent Donnefort
2021-06-04 18:25   ` Matthias Kaehlcke
2021-06-04 11:06 ` [PATCH v3 5/6] cpufreq: Mark inefficient frequencies using the Energy Model Vincent Donnefort
2021-06-04 18:35   ` Matthias Kaehlcke
2021-06-04 11:06 ` [PATCH v3 6/6] PM / EM: Skip inefficient states Vincent Donnefort
2021-06-04 18:49   ` Matthias Kaehlcke

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='CAJZ5v0h+zZZOn70eGD9XZy0rcy0ic-C1=UC7YGLhUahVgC4pzg@mail.gmail.com' \
    --to=rafael@kernel.org \
    --cc=dietmar.eggemann@arm.com \
    --cc=ionela.voinescu@arm.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=peterz@infradead.org \
    --cc=qperret@google.com \
    --cc=rjw@rjwysocki.net \
    --cc=vincent.donnefort@arm.com \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@linaro.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.