Skip to content

sched: cpufreq: Track util update flags

Viresh Kumar linux-pm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 37 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4cpufreq: schedutil: Initialize sg_cpu->flags to 0kernel/sched/cpufreq_schedutil.c+1 -12 replies
2/4sched: cpufreq: Keep track of cpufreq utilization update flagsinclude/linux/sched/cpufreq.h kernel/sched/cpufreq_schedutil.c kernel/sched/deadline.c +2 more+38 -631 replies
3/4cpufreq: schedutil: Don't pass flags to sugov_set_iowait_boost()kernel/sched/cpufreq_schedutil.c+4 -51 reply
4/4cpufreq: schedutil: Don't call sugov_get_util() unnecessarilykernel/sched/cpufreq_schedutil.c+2 -23 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchJuri LelliJoel Fernandes
1/4R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] sched: cpufreq: Track util update flags

Hi,

Currently the schedutil governor overwrites the sg_cpu->flags field on every call to the utilization handler. It was pretty good as the initial implementation of utilization handlers, there are several drawbacks though.

The biggest drawback is that the sg_cpu->flags field doesn't always represent the correct type of tasks that are enqueued on a CPU's rq. For example, if a fair task is enqueued while a RT or DL task is running, we will overwrite the flags with value 0 and that may take the CPU to lower OPPs unintentionally. There can be other corner cases as well which we aren't aware of currently.

This patchset tries to solve these problems by taking a different approach than overwriting flags, i.e. set and reset them. The second patch does that transition, other three patches are minor optimizations here and there, but related to this work.

Tested these on hikey620 with cyclictest, perf-pipe, hackbench and ebizzy and no obvious regressions were seen.

Based over linux-next/master (as I wanted both tip/master and pm/linux-next).

--
viresh

Viresh Kumar (4):
cpufreq: schedutil: Initialize sg_cpu->flags to 0
sched: cpufreq: Keep track of cpufreq utilization update flags
cpufreq: schedutil: Don't pass flags to sugov_set_iowait_boost()
cpufreq: schedutil: Don't call sugov_get_util() unnecessarily

 include/linux/sched/cpufreq.h    |  7 ++++++-
 kernel/sched/cpufreq_schedutil.c | 36 +++++++++++++++++++++++++-----------
 kernel/sched/deadline.c          |  4 ++++
 kernel/sched/fair.c              |  8 ++++++--
 kernel/sched/rt.c                |  4 ++++
 5 files changed, 45 insertions(+), 14 deletions(-)
Signature · 1 line
2.15.0.194.g9af6a3dea062