[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190506044836.2914-5-luca.abeni@santannapisa.it>
Date: Mon, 6 May 2019 06:48:34 +0200
From: Luca Abeni <luca.abeni@...tannapisa.it>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J . Wysocki" <rafael@...nel.org>,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Vincent Guittot <vincent.guittot@...aro.org>,
"Paul E . McKenney" <paulmck@...ux.ibm.com>,
Joel Fernandes <joel@...lfernandes.org>,
Quentin Perret <quentin.perret@....com>,
Luc Van Oostenryck <luc.vanoostenryck@...il.com>,
Morten Rasmussen <morten.rasmussen@....com>,
Juri Lelli <juri.lelli@...hat.com>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Patrick Bellasi <patrick.bellasi@....com>,
Tommaso Cucinotta <tommaso.cucinotta@...tannapisa.it>,
luca abeni <luca.abeni@...tannapisa.it>
Subject: [RFC PATCH 4/6] sched/dl: Improve capacity-aware wakeup
From: luca abeni <luca.abeni@...tannapisa.it>
Instead of considering the "static CPU bandwidth" allocated to
a SCHED_DEADLINE task (ratio between its maximum runtime and
reservation period), try to use the remaining runtime and time
to scheduling deadline.
Signed-off-by: luca abeni <luca.abeni@...tannapisa.it>
---
kernel/sched/cpudeadline.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/cpudeadline.c b/kernel/sched/cpudeadline.c
index d21f7905b9c1..111dd9ac837b 100644
--- a/kernel/sched/cpudeadline.c
+++ b/kernel/sched/cpudeadline.c
@@ -114,8 +114,13 @@ static inline int dl_task_fit(const struct sched_dl_entity *dl_se,
int cpu, u64 *c)
{
u64 cap = (arch_scale_cpu_capacity(NULL, cpu) * arch_scale_freq_capacity(cpu)) >> SCHED_CAPACITY_SHIFT;
- s64 rel_deadline = dl_se->dl_deadline;
- u64 rem_runtime = dl_se->dl_runtime;
+ s64 rel_deadline = dl_se->deadline - sched_clock_cpu(smp_processor_id());
+ u64 rem_runtime = dl_se->runtime;
+
+ if ((rel_deadline < 0) || (rel_deadline * dl_se->dl_runtime < dl_se->dl_deadline * rem_runtime)) {
+ rel_deadline = dl_se->dl_deadline;
+ rem_runtime = dl_se->dl_runtime;
+ }
if (c)
*c = cap;
--
2.20.1
Powered by blists - more mailing lists