From: tip-bot for Patrick Bellasi <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: juri.lelli@redhat.com, joelaf@google.com,
patrick.bellasi@arm.com, peterz@infradead.org,
morten.rasmussen@arm.com, tglx@linutronix.de, tkjos@android.com,
torvalds@linux-foundation.org, vincent.guittot@linaro.org,
linux-kernel@vger.kernel.org, smuckle@google.com,
rafael.j.wysocki@intel.com, mingo@kernel.org,
dietmar.eggemann@arm.com, pjt@google.com,
viresh.kumar@linaro.org, hpa@zytor.com
Subject: [tip:sched/core] sched/cpufreq/schedutil: Use util_est for OPP selection
Date: Tue, 20 Mar 2018 04:08:31 -0700 [thread overview]
Message-ID: <tip-a07630b8b2c16f82fd5b71d890079f4dd7599c1d@git.kernel.org> (raw)
In-Reply-To: <20180309095245.11071-4-patrick.bellasi@arm.com>
Commit-ID: a07630b8b2c16f82fd5b71d890079f4dd7599c1d
Gitweb: https://git.kernel.org/tip/a07630b8b2c16f82fd5b71d890079f4dd7599c1d
Author: Patrick Bellasi <patrick.bellasi@arm.com>
AuthorDate: Fri, 9 Mar 2018 09:52:44 +0000
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 20 Mar 2018 08:11:08 +0100
sched/cpufreq/schedutil: Use util_est for OPP selection
When schedutil looks at the CPU utilization, the current PELT value for
that CPU is returned straight away. In certain scenarios this can have
undesired side effects and delays on frequency selection.
For example, since the task utilization is decayed at wakeup time, a
long sleeping big task newly enqueued does not add immediately a
significant contribution to the target CPU. This introduces some latency
before schedutil will be able to detect the best frequency required by
that task.
Moreover, the PELT signal build-up time is a function of the current
frequency, because of the scale invariant load tracking support. Thus,
starting from a lower frequency, the utilization build-up time will
increase even more and further delays the selection of the actual
frequency which better serves the task requirements.
In order to reduce these kind of latencies, we integrate the usage
of the CPU's estimated utilization in the sugov_get_util function.
This allows to properly consider the expected utilization of a CPU which,
for example, has just got a big task running after a long sleep period.
Ultimately this allows to select the best frequency to run a task
right after its wake-up.
Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Joel Fernandes <joelaf@google.com>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Morten Rasmussen <morten.rasmussen@arm.com>
Cc: Paul Turner <pjt@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steve Muckle <smuckle@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Todd Kjos <tkjos@android.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Link: http://lkml.kernel.org/r/20180309095245.11071-4-patrick.bellasi@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/sched/sched.h | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 22909ffc04fb..c3deaee7a7a2 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -2163,6 +2163,13 @@ static inline unsigned long cpu_util_dl(struct rq *rq)
static inline unsigned long cpu_util_cfs(struct rq *rq)
{
- return rq->cfs.avg.util_avg;
+ unsigned long util = READ_ONCE(rq->cfs.avg.util_avg);
+
+ if (sched_feat(UTIL_EST)) {
+ util = max_t(unsigned long, util,
+ READ_ONCE(rq->cfs.avg.util_est.enqueued));
+ }
+
+ return util;
}
#endif
next prev parent reply other threads:[~2018-03-20 11:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-09 9:52 [PATCH v6 0/4] Utilization estimation (util_est) for FAIR tasks Patrick Bellasi
2018-03-09 9:52 ` [PATCH v6 1/4] sched/fair: add util_est on top of PELT Patrick Bellasi
2018-03-20 11:07 ` [tip:sched/core] sched/fair: Add " tip-bot for Patrick Bellasi
2018-03-09 9:52 ` [PATCH v6 2/4] sched/fair: use util_est in LB and WU paths Patrick Bellasi
2018-03-20 11:08 ` [tip:sched/core] sched/fair: Use " tip-bot for Patrick Bellasi
2018-03-09 9:52 ` [PATCH v6 3/4] sched/cpufreq_schedutil: use util_est for OPP selection Patrick Bellasi
2018-03-20 11:08 ` tip-bot for Patrick Bellasi [this message]
2018-03-09 9:52 ` [PATCH v6 4/4] sched/fair: update util_est only on util_avg updates Patrick Bellasi
2018-03-20 11:09 ` [tip:sched/core] sched/fair: Update " tip-bot for Patrick Bellasi
2018-03-16 13:25 ` [PATCH v6 0/4] Utilization estimation (util_est) for FAIR tasks Peter Zijlstra
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=tip-a07630b8b2c16f82fd5b71d890079f4dd7599c1d@git.kernel.org \
--to=tipbot@zytor.com \
--cc=dietmar.eggemann@arm.com \
--cc=hpa@zytor.com \
--cc=joelaf@google.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=morten.rasmussen@arm.com \
--cc=patrick.bellasi@arm.com \
--cc=peterz@infradead.org \
--cc=pjt@google.com \
--cc=rafael.j.wysocki@intel.com \
--cc=smuckle@google.com \
--cc=tglx@linutronix.de \
--cc=tkjos@android.com \
--cc=torvalds@linux-foundation.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome