[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170512075724.0167e9cd@nowhere>
Date: Fri, 12 May 2017 07:57:24 +0200
From: luca abeni <luca.abeni@...tannapisa.it>
To: Xunlei Pang <xlpang@...hat.com>
Cc: linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@....com>,
Ingo Molnar <mingo@...hat.com>,
Steven Rostedt <rostedt@...dmis.org>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Luca Abeni <luca.abeni@...tn.it>
Subject: Re: [PATCH v2 2/3] sched/deadline: Throttle the task when missing
its deadline
Hi again,
(sorry for the previous email; I replied from gmail and I did not
realize I was sending it in html).
On Fri, 12 May 2017 11:32:08 +0800
Xunlei Pang <xlpang@...hat.com> wrote:
> dl_runtime_exceeded() only checks negative runtime, actually
> when the current deadline past, we should start a new period
> and zero out the remaining runtime as well.
In this case, I think global EDF wants to allow the task to run with
its remaining runtime even also missing a deadline, so I think this
change is not correct.
(when using global EDF, tasks scheduled on multiple CPUs can miss their
deadlines... Setting the runtime to 0 as soon as a deadline is missed
would break global EDF scheduling)
Which kind of issue is this patch fixing? If it is something you saw
with deadline-constrained tasks, maybe you can add a check for
deadline!=period?
Luca
>
> This patch improves dl_runtime_exceeded() to achieve that.
>
> Fixes: 269ad8015a6b ("sched/deadline: Avoid double-accounting in case
> of missed deadlines") Cc: Luca Abeni <luca.abeni@...tn.it>
> Signed-off-by: Xunlei Pang <xlpang@...hat.com>
> ---
> kernel/sched/deadline.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index d3d291e..5691149 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -729,8 +729,13 @@ static inline void
> dl_check_constrained_dl(struct sched_dl_entity *dl_se) }
>
> static
> -int dl_runtime_exceeded(struct sched_dl_entity *dl_se)
> +int dl_runtime_exceeded(struct rq *rq, struct sched_dl_entity *dl_se)
> {
> + bool dmiss = dl_time_before(dl_se->deadline, rq_clock(rq));
> +
> + if (dmiss && dl_se->runtime > 0)
> + dl_se->runtime = 0;
> +
> return (dl_se->runtime <= 0);
> }
>
> @@ -781,7 +786,7 @@ static void update_curr_dl(struct rq *rq)
> dl_se->runtime -= delta_exec;
>
> throttle:
> - if (dl_runtime_exceeded(dl_se) || dl_se->dl_yielded) {
> + if (dl_runtime_exceeded(rq, dl_se) || dl_se->dl_yielded) {
> dl_se->dl_throttled = 1;
> __dequeue_task_dl(rq, curr, 0);
> if (unlikely(dl_se->dl_boosted
> || !start_dl_timer(curr)))
Powered by blists - more mailing lists