mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vincent Guittot <vincent.guittot@linaro.org>
To: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org
Cc: rjw@rjwysocki.net, juri.lelli@arm.com, dietmar.eggemann@arm.com,
	Morten.Rasmussen@arm.com,
	Vincent Guittot <vincent.guittot@linaro.org>
Subject: [PATCH 2/2] cpufreq/schedutil: add rt utilization tracking
Date: Wed, 24 May 2017 11:00:52 +0200	[thread overview]
Message-ID: <1495616452-7582-3-git-send-email-vincent.guittot@linaro.org> (raw)
In-Reply-To: <1495616452-7582-1-git-send-email-vincent.guittot@linaro.org>

Add both cfs_rq and rt_rq's utilization when selecting an OPP for cfs task
as rt task can preempt and steal cfs's running time.
This prevent frequency drops when rt tasks steal running time to cfs tasks
which appear lower than they are.

Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
---
 kernel/sched/cpufreq_schedutil.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
index 622eed1..bc292b92 100644
--- a/kernel/sched/cpufreq_schedutil.c
+++ b/kernel/sched/cpufreq_schedutil.c
@@ -164,7 +164,7 @@ static void sugov_get_util(unsigned long *util, unsigned long *max)
 
 	cfs_max = arch_scale_cpu_capacity(NULL, smp_processor_id());
 
-	*util = min(rq->cfs.avg.util_avg, cfs_max);
+	*util = min(rq->cfs.avg.util_avg + rq->rt.avg.util_avg, cfs_max);
 	*max = cfs_max;
 }
 
-- 
2.7.4

      parent reply	other threads:[~2017-05-24  9:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-24  9:00 [PATCH 0/2] track rt rq utilization Vincent Guittot
2017-05-24  9:00 ` [RFC PATCH 1/2] sched/rt: add utilization tracking Vincent Guittot
2017-05-30 15:50   ` Morten Rasmussen
2017-05-30 16:24     ` Vincent Guittot
2017-05-31  7:57       ` Morten Rasmussen
2017-05-31  9:40   ` Peter Zijlstra
2017-05-31 10:30     ` Peter Zijlstra
2017-05-31 10:41       ` Juri Lelli
2017-05-31 11:39         ` Peter Zijlstra
2017-05-31 11:24     ` Vincent Guittot
2017-05-24  9:00 ` Vincent Guittot [this message]

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=1495616452-7582-3-git-send-email-vincent.guittot@linaro.org \
    --to=vincent.guittot@linaro.org \
    --cc=Morten.Rasmussen@arm.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rjw@rjwysocki.net \
    /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

all inboxes | Powered by JetHome®