public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Wanpeng Li <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: ktkhai@parallels.com, juri.lelli@arm.com, tglx@linutronix.de,
	wanpeng.li@linux.intel.com, torvalds@linux-foundation.org,
	mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org,
	peterz@infradead.org
Subject: [tip:sched/core] sched/deadline: Fix artificial overrun introduced by yield_task_dl()
Date: Tue, 4 Nov 2014 08:11:07 -0800	[thread overview]
Message-ID: <tip-804968809c321066cca028d4cbd533a420f964bc@git.kernel.org> (raw)
In-Reply-To: <1414708776-124078-2-git-send-email-wanpeng.li@linux.intel.com>

Commit-ID:  804968809c321066cca028d4cbd533a420f964bc
Gitweb:     http://git.kernel.org/tip/804968809c321066cca028d4cbd533a420f964bc
Author:     Wanpeng Li <wanpeng.li@linux.intel.com>
AuthorDate: Fri, 31 Oct 2014 06:39:32 +0800
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 4 Nov 2014 07:17:53 +0100

sched/deadline: Fix artificial overrun introduced by yield_task_dl()

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 make
sure we don't steal some more time from the task that yielded in update_curr_dl().

Suggested-by: Juri Lelli <juri.lelli@arm.com>
Signed-off-by: Wanpeng Li <wanpeng.li@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Kirill Tkhai <ktkhai@parallels.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/1414708776-124078-2-git-send-email-wanpeng.li@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/sched/deadline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 9d483e8..c047a94 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -628,7 +628,7 @@ static void update_curr_dl(struct rq *rq)
 
 	sched_rt_avg_update(rq, delta_exec);
 
-	dl_se->runtime -= delta_exec;
+	dl_se->runtime -= dl_se->dl_yielded ? 0 : delta_exec;
 	if (dl_runtime_exceeded(rq, dl_se)) {
 		__dequeue_task_dl(rq, curr, 0);
 		if (likely(start_dl_timer(dl_se, curr->dl.dl_boosted)))

  reply	other threads:[~2014-11-04 16:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-30 22:39 [PATCH v3 1/6] sched/rt: cleanup check preempt equal prio Wanpeng Li
2014-10-30 22:39 ` [PATCH v3 2/6] sched/deadline: fix artificial overrun introduced by yield_task_dl Wanpeng Li
2014-11-04 16:11   ` tip-bot for Wanpeng Li [this message]
2014-10-30 22:39 ` [PATCH v3 3/6] sched/deadline: add deadline rq status print Wanpeng Li
2014-11-04 16:11   ` [tip:sched/core] sched/deadline: Add " tip-bot for Wanpeng Li
2014-10-30 22:39 ` [PATCH v3 4/6] sched/deadline: push task away if the deadline is equal to curr during wakeup Wanpeng Li
2014-11-04 16:11   ` [tip:sched/core] sched/deadline: Push " tip-bot for Wanpeng Li
2014-10-30 22:39 ` [PATCH v3 5/6] sched/deadline: reschedule from switched_from_dl() after a successful pull Wanpeng Li
2014-11-04 16:11   ` [tip:sched/core] sched/deadline: Reschedule from switched_from_dl () " tip-bot for Wanpeng Li
2014-10-30 22:39 ` [PATCH v3 6/6] sched/deadline: don't check CONFIG_SMP in switched_from_dl Wanpeng Li
2014-11-04 16:12   ` [tip:sched/core] sched/deadline: Don' t check CONFIG_SMP in switched_from_dl() tip-bot for Wanpeng Li
2014-11-04 16:10 ` [tip:sched/core] sched/rt: Clean up check_preempt_equal_prio() tip-bot for 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=tip-804968809c321066cca028d4cbd533a420f964bc@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=hpa@zytor.com \
    --cc=juri.lelli@arm.com \
    --cc=ktkhai@parallels.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=wanpeng.li@linux.intel.com \
    /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