[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKfTPtBzsX6GKZP_NGTONrkp96qx9uOHr0+XG7tC6ELy4tbHBg@mail.gmail.com>
Date: Fri, 21 Feb 2025 12:49:02 +0100
From: Vincent Guittot <vincent.guittot@...aro.org>
To: Abel Wu <wuyun.abel@...edance.com>
Cc: Ingo Molnar <mingo@...hat.com>, Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>, Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>, Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
Valentin Schneider <vschneid@...hat.com>, Josh Don <joshdon@...gle.com>,
Tianchen Ding <dtcccc@...ux.alibaba.com>,
"open list:SCHEDULER" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] sched/fair: Fix premature check of WAKEUP_PREEMPTION
On Fri, 21 Feb 2025 at 12:12, Abel Wu <wuyun.abel@...edance.com> wrote:
>
> Idle tasks are by definition preempted by non-idle tasks whether feat
> WAKEUP_PREEMPTION is enabled or not. This isn't true any longer since
I don't think it's true, only "sched_idle never preempts others" is
always true but sched_feat(WAKEUP_PREEMPTION) is mainly there for
debug purpose so if WAKEUP_PREEMPTION is false then nobody preempts
others at wakeup, idle, batch or normal
> commit faa42d29419d ("sched/fair: Make SCHED_IDLE entity be preempted in strict hierarchy")
> which gives priority to WAKEUP_PREEMPTION, so when !FAIR_GROUP_SCHED,
> SCHED_IDLE tasks do not preempt by non-idle tasks.
>
> Fixes: faa42d29419d ("sched/fair: Make SCHED_IDLE entity be preempted in strict hierarchy")
> Signed-off-by: Abel Wu <wuyun.abel@...edance.com>
> ---
> kernel/sched/fair.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 4340178f29b7..de9a2689de9c 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -8768,9 +8768,6 @@ static void check_preempt_wakeup_fair(struct rq *rq, struct task_struct *p, int
> if (test_tsk_need_resched(rq->curr))
> return;
>
> - if (!sched_feat(WAKEUP_PREEMPTION))
> - return;
> -
> find_matching_se(&se, &pse);
> WARN_ON_ONCE(!pse);
>
> @@ -8783,6 +8780,9 @@ static void check_preempt_wakeup_fair(struct rq *rq, struct task_struct *p, int
> if (cse_is_idle && !pse_is_idle)
> goto preempt;
>
> + if (!sched_feat(WAKEUP_PREEMPTION))
> + return;
> +
> /*
> * IDLE entities do not preempt others.
> */
> --
> 2.37.3
>
Powered by blists - more mailing lists