From: Wanpeng Li <wanpeng.li@linux.intel.com>
To: Ingo Molnar <mingo@redhat.com>, Peter Zijlstra <peterz@infradead.org>
Cc: Juri Lelli <juri.lelli@arm.com>,
linux-kernel@vger.kernel.org,
Wanpeng Li <wanpeng.li@linux.intel.com>
Subject: [PATCH 2/6] sched/dl: fix yield task artificial overrun
Date: Mon, 27 Oct 2014 09:41:03 +0800 [thread overview]
Message-ID: <1414374067-7209-2-git-send-email-wanpeng.li@linux.intel.com> (raw)
In-Reply-To: <1414374067-7209-1-git-send-email-wanpeng.li@linux.intel.com>
The yield semantic of deadline class is to reduce remaining runtime to
zero, and then update_curr_dl() will stop it. However, comsumed bandwidth
is reduced from the budget of yield task again even if it has already been
set to zero which leads to artificial overrun. This patch fix it by reduce
remaining runtime to zero if there is still remaining runtime after comsumed
bandwidth is accumulated.
Signed-off-by: Wanpeng Li <wanpeng.li@linux.intel.com>
---
kernel/sched/deadline.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index abfaf3d..d4ffc1e 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -568,7 +568,12 @@ static
int dl_runtime_exceeded(struct rq *rq, struct sched_dl_entity *dl_se)
{
int dmiss = dl_time_before(dl_se->deadline, rq_clock(rq));
- int rorun = dl_se->runtime <= 0;
+ int rorun;
+
+ if (dl_se->dl_yielded && dl_se->runtime > 0)
+ dl_se->runtime = 0;
+
+ rorun = dl_se->runtime <= 0;
if (!rorun && !dmiss)
return 0;
@@ -897,10 +902,8 @@ static void yield_task_dl(struct rq *rq)
* it and the bandwidth timer will wake it up and will give it
* new scheduling parameters (thanks to dl_yielded=1).
*/
- if (p->dl.runtime > 0) {
+ if (p->dl.runtime > 0)
rq->curr->dl.dl_yielded = 1;
- p->dl.runtime = 0;
- }
update_curr_dl(rq);
}
--
1.9.1
next prev parent reply other threads:[~2014-10-27 1:41 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-27 1:41 [PATCH 1/6] sched/rt: check if curr can be pushed/pulled somewhere else in advance Wanpeng Li
2014-10-27 1:41 ` Wanpeng Li [this message]
2014-10-29 16:33 ` [PATCH 2/6] sched/dl: fix yield task artificial overrun Juri Lelli
2014-10-29 22:49 ` Wanpeng Li
2014-10-30 10:04 ` Juri Lelli
2014-10-27 1:41 ` [PATCH 3/6] sched/dl: add deadline rq status print Wanpeng Li
2014-10-29 16:52 ` Juri Lelli
2014-10-29 22:52 ` Wanpeng Li
2014-10-27 1:41 ` [PATCH 4/6] sched/dl: push task away if the deadline is equal to curr during wakeup Wanpeng Li
2014-10-29 17:08 ` Juri Lelli
2014-10-27 1:41 ` [PATCH 5/6] sched/dl: reschedule if successfully pull earlier deadline task Wanpeng Li
2014-10-29 22:59 ` Wanpeng Li
2014-10-30 10:21 ` Juri Lelli
2014-10-30 13:12 ` Wanpeng Li
2014-10-30 14:42 ` Juri Lelli
2014-10-31 15:37 ` Peter Zijlstra
2014-10-27 1:41 ` [PATCH 6/6] sched/dl: don't check CONFIG_SMP in switched_from_dl Wanpeng Li
2014-10-30 10:29 ` Juri Lelli
2014-10-29 22:57 ` [PATCH 1/6] sched/rt: check if curr can be pushed/pulled somewhere else in advance Wanpeng Li
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=1414374067-7209-2-git-send-email-wanpeng.li@linux.intel.com \
--to=wanpeng.li@linux.intel.com \
--cc=juri.lelli@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.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