All of lore.kernel.org
 help / color / mirror / Atom feed
From: luca abeni <luca.abeni@santannapisa.it>
To: Daniel Bristot de Oliveira <bristot@redhat.com>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@arm.com>,
	Tommaso Cucinotta <tommaso.cucinotta@sssup.it>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH 1/2] sched/deadline: Replenishment timer should fire in the next period
Date: Sat, 11 Feb 2017 08:12:37 +0100	[thread overview]
Message-ID: <20170211081237.0a9208be@sweethome> (raw)
In-Reply-To: <77018c2ce2a17342b5d17cdb50209e667800b09a.1486754348.git.bristot@redhat.com>

Hi Daniel,

On Fri, 10 Feb 2017 20:48:10 +0100
Daniel Bristot de Oliveira <bristot@redhat.com> wrote:

[...]
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index 70ef2b1..3c94d85 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -505,10 +505,15 @@ static void update_dl_entity(struct
> sched_dl_entity *dl_se, }
>  }
>  
> +static inline u64 dl_next_period(struct sched_dl_entity *dl_se)
> +{
> +	return dl_se->deadline - dl_se->dl_deadline +
> dl_se->dl_period; +}
> +
>  /*
>   * If the entity depleted all its runtime, and if we want it to sleep
>   * while waiting for some new execution time to become available, we
> - * set the bandwidth enforcement timer to the replenishment instant
> + * set the bandwidth replenishment timer to the replenishment instant
>   * and try to activate it.
>   *
>   * Notice that it is important for the caller to know if the timer
> @@ -530,7 +535,7 @@ static int start_dl_timer(struct task_struct *p)
>  	 * that it is actually coming from rq->clock and not from
>  	 * hrtimer's time base reading.
>  	 */
> -	act = ns_to_ktime(dl_se->deadline);
> +	act = ns_to_ktime(dl_next_period(dl_se));

Looks like there is a real bug in the code, and your fix looks correct
to me. I think it should be committed.


			Thanks,
				Luca


>  	now = hrtimer_cb_get_time(timer);
>  	delta = ktime_to_ns(now) - rq_clock(rq);
>  	act = ktime_add_ns(act, delta);

  parent reply	other threads:[~2017-02-11  7:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-10 19:48 [PATCH 0/2] sched/deadline: Fixes for constrained deadline tasks Daniel Bristot de Oliveira
2017-02-10 19:48 ` [PATCH 1/2] sched/deadline: Replenishment timer should fire in the next period Daniel Bristot de Oliveira
2017-02-10 21:47   ` Steven Rostedt
2017-02-11  7:12   ` luca abeni [this message]
2017-02-13 11:10     ` Peter Zijlstra
2017-02-13 14:59       ` Steven Rostedt
2017-02-13 15:35         ` Juri Lelli
2017-02-10 19:48 ` [PATCH 2/2] sched/deadline: Throttle a constrained deadline task activated after the deadline Daniel Bristot de Oliveira
2017-02-11  7:15   ` luca abeni
2017-02-11  8:00     ` Mike Galbraith
2017-02-11 14:35       ` Steven Rostedt
2017-02-13 11:12     ` Peter Zijlstra
2017-02-13 11:12   ` Peter Zijlstra
2017-02-13 13:16     ` Daniel Bristot de Oliveira
2017-02-13 15:33   ` Steven Rostedt
2017-02-13 15:46     ` Daniel Bristot de Oliveira
2017-02-13 16:21       ` Daniel Bristot de Oliveira

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=20170211081237.0a9208be@sweethome \
    --to=luca.abeni@santannapisa.it \
    --cc=bristot@redhat.com \
    --cc=juri.lelli@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tommaso.cucinotta@sssup.it \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.