public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Wanpeng Li <kernellwp@gmail.com>
To: Juri Lelli <juri.lelli@arm.com>,
	Wanpeng Li <wanpeng.li@linux.intel.com>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/6] sched/dl: fix yield task artificial overrun
Date: Thu, 30 Oct 2014 06:49:51 +0800	[thread overview]
Message-ID: <54516F0F.7000901@gmail.com> (raw)
In-Reply-To: <545116F7.7080607@arm.com>

Hi Juri,
2014/10/30 0:33, Juri Lelli:
> Hi,
>
> On 27/10/14 01:41, Wanpeng Li wrote:
>> 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.
>>
> Oh, right. But, how about what below instead (with a proper comment
> and changelog)?
>
> Thanks,
>
> - Juri
>
>  From 108ecdff52b154ea2c79d4aac552ddf1ead871c7 Mon Sep 17 00:00:00 2001
> From: Juri Lelli <juri.lelli@arm.com>
> Date: Wed, 29 Oct 2014 16:09:06 +0000
> Subject: [PATCH] sched/deadline: fix artificial overrun introduced by
>   yield_task_dl
>
> Signed-off-by: Juri Lelli <juri.lelli@arm.com>
> ---
>   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 2e31a30..db6ad38 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -633,7 +633,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_se->dl_yielded && dl_se->runtime > 0)
+		dl_se->runtime = 0;

Maybe this can be moved to update_curr_dl().

I think the consumed bandwidth still should be reduced from remaining 
runtime even if yield, then the remaining runtime will be reset to 0 if 
there is still remaining runtime as what my patch do. What's your option?

Regards,
Wanpeng Li

>   	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-10-29 22:50 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 ` [PATCH 2/6] sched/dl: fix yield task artificial overrun Wanpeng Li
2014-10-29 16:33   ` Juri Lelli
2014-10-29 22:49     ` Wanpeng Li [this message]
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=54516F0F.7000901@gmail.com \
    --to=kernellwp@gmail.com \
    --cc=juri.lelli@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.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