[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAKfTPtBAxgBkH4f-c7sHQr1=E4oaFRnyY7+dh41_ONqi9MEKEQ@mail.gmail.com>
Date: Fri, 7 Feb 2025 15:50:40 +0100
From: Vincent Guittot <vincent.guittot@...aro.org>
To: zihan zhou <15645113830zzh@...il.com>
Cc: mingo@...hat.com, peterz@...radead.org, juri.lelli@...hat.com,
dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com,
mgorman@...e.de, vschneid@...hat.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH V1] sched: Cancel the slice protection of the idle entity
On Tue, 21 Jan 2025 at 04:07, zihan zhou <15645113830zzh@...il.com> wrote:
>
> A wakeup non-idle entity should preempt idle entity at any time,
> but because of the slice protection of the idle entity, the non-idle
> entity has to wait, so just cancel it.
Probably worth to add:
Fixes: 63304558ba5d ("sched/eevdf: Curb wakeup-preemption")
>
> Signed-off-by: zihan zhou <15645113830zzh@...il.com>
I have been able to reproduce the problem with rt-app.
Reviewed-by: Vincent Guittot <vincent.guittot@...aro.org>
Tested-by: Vincent Guittot <vincent.guittot@...aro.org>
> ---
> kernel/sched/fair.c | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 3e9ca38512de..7777d110d053 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -8851,8 +8851,19 @@ static void check_preempt_wakeup_fair(struct rq *rq, struct task_struct *p, int
> * Preempt an idle entity in favor of a non-idle entity (and don't preempt
> * in the inverse case).
> */
> - if (cse_is_idle && !pse_is_idle)
> + if (cse_is_idle && !pse_is_idle) {
> +
remove blank line above
> + /*
> + * When non-idle entity preempt an idle entity,
> + * don't give idle entity slice protection.
> + */
> + if (se->vlag == se->deadline)
> + se->vlag = se->deadline + 1;
> +
> goto preempt;
> +
remove blank line above
> + }
> +
> if (cse_is_idle != pse_is_idle)
> return;
>
> --
> 2.33.0
>
Powered by blists - more mailing lists