mbox series

[V3,0/5] cpufreq: Record stats with fast-switching

Message ID cover.1601884370.git.viresh.kumar@linaro.org
Headers show
Series cpufreq: Record stats with fast-switching | expand

Message

Viresh Kumar Oct. 5, 2020, 7:56 a.m. UTC
Hi,

We disabled recording cpufreq stats when fast switching was introduced
to the cpufreq core as the cpufreq stats required to take a spinlock and
that can't be allowed (for performance reasons) on scheduler's hot path.

Here is an attempt to get rid of the lock and bring back the support.

V2->V3:
- Use READ/WRITE_ONCE() for reset-time as well.
- Use unlikely for few conditionals in the hot path.
- Better changelogs.
- Rebase changes.

V1-V2:
- Use READ_ONCE/WRITE_ONCE instead of atomic in the first patch.

--
Viresh

Viresh Kumar (5):
  cpufreq: stats: Defer stats update to
    cpufreq_stats_record_transition()
  cpufreq: stats: Remove locking
  cpufreq: stats: Mark few conditionals with unlikely()
  cpufreq: stats: Enable stats for fast-switch as well
  cpufreq: Move traces and update to policy->cur to cpufreq core

 drivers/cpufreq/cpufreq.c        | 11 ++++
 drivers/cpufreq/cpufreq_stats.c  | 89 ++++++++++++++++++++------------
 kernel/sched/cpufreq_schedutil.c | 12 +----
 3 files changed, 69 insertions(+), 43 deletions(-)

Comments

Rafael J. Wysocki Oct. 5, 2020, 1:25 p.m. UTC | #1
On Mon, Oct 5, 2020 at 9:56 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
>
> Hi,
>
> We disabled recording cpufreq stats when fast switching was introduced
> to the cpufreq core as the cpufreq stats required to take a spinlock and
> that can't be allowed (for performance reasons) on scheduler's hot path.
>
> Here is an attempt to get rid of the lock and bring back the support.
>
> V2->V3:
> - Use READ/WRITE_ONCE() for reset-time as well.
> - Use unlikely for few conditionals in the hot path.
> - Better changelogs.
> - Rebase changes.
>
> V1-V2:
> - Use READ_ONCE/WRITE_ONCE instead of atomic in the first patch.
>
> --
> Viresh
>
> Viresh Kumar (5):
>   cpufreq: stats: Defer stats update to
>     cpufreq_stats_record_transition()
>   cpufreq: stats: Remove locking
>   cpufreq: stats: Mark few conditionals with unlikely()
>   cpufreq: stats: Enable stats for fast-switch as well
>   cpufreq: Move traces and update to policy->cur to cpufreq core
>
>  drivers/cpufreq/cpufreq.c        | 11 ++++
>  drivers/cpufreq/cpufreq_stats.c  | 89 ++++++++++++++++++++------------
>  kernel/sched/cpufreq_schedutil.c | 12 +----
>  3 files changed, 69 insertions(+), 43 deletions(-)
>
> --

The entire series applied as 5.10 material with some minor changelog
edits in patch [1/5], thanks!