mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] [sched] Don't account time after deadline twice
@ 2014-06-30  1:26 Zhihui Zhang
  2014-07-01 13:08 ` Peter Zijlstra
  0 siblings, 1 reply; 5+ messages in thread
From: Zhihui Zhang @ 2014-06-30  1:26 UTC (permalink / raw)
  To: mingo, peterz; +Cc: linux-kernel

Unless we want to double-penalize an overrun task, the time after the deadline
and before the current time is already accounted in the negative dl_se->runtime
value. So we can leave it as is in the case of dmiss && rorun.

Signed-off-by: Zhihui Zhang <zzhsuny@gmail.com>
---
 kernel/sched/deadline.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index fc4f98b1..67df0d6 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -579,10 +579,8 @@ int dl_runtime_exceeded(struct rq *rq, struct sched_dl_entity *dl_se)
 	 * the next instance. Thus, if we do not account that, we are
 	 * stealing bandwidth from the system at each deadline miss!
 	 */
-	if (dmiss) {
-		dl_se->runtime = rorun ? dl_se->runtime : 0;
-		dl_se->runtime -= rq_clock(rq) - dl_se->deadline;
-	}
+	if (dmiss && !rorun)
+		dl_se->runtime = dl_se->deadline - rq_clock(rq);
 
 	return 1;
 }
-- 
1.8.1.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-07-04  1:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-30  1:26 [PATCH] [sched] Don't account time after deadline twice Zhihui Zhang
2014-07-01 13:08 ` Peter Zijlstra
2014-07-01 13:59   ` Juri Lelli
     [not found]     ` <CADFvMYKzpihC3GLwNFZW0KCrZQY5FDSH5EQd4iLmHLK+hauDWA@mail.gmail.com>
2014-07-03  9:50       ` Juri Lelli
2014-07-04  1:41         ` Zhihui Zhang

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