[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230829144212.0eedc210@rorschach.local.home>
Date: Tue, 29 Aug 2023 14:42:12 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Wang You <wangyoua@...ontech.com>
Cc: mingo@...hat.com, peterz@...radead.org, juri.lelli@...hat.com,
vincent.guittot@...aro.org, dietmar.eggemann@....com,
bsegall@...gle.com, mgorman@...e.de, bristot@...hat.com,
vschneid@...hat.com, linux-kernel@...r.kernel.org
Subject: Re: [RFC] remove preempt in do_sched_yield
On Wed, 23 Aug 2023 18:07:05 +0800
Wang You <wangyoua@...ontech.com> wrote:
> I see do_sched_yield's irq disable cover preempt disable. In this
> function, I think preempt op may not work, or it may have some
> special effect ? Thanks.
Why would it not work?
>
> Signed-off-by: Wang You <wangyoua@...ontech.com>
> ---
> kernel/sched/core.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index a68d1276bab0..b255e54c1d38 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -8487,10 +8487,7 @@ static void do_sched_yield(void)
>
> schedstat_inc(rq->yld_count);
> current->sched_class->yield_task(rq);
> -
> - preempt_disable();
> rq_unlock_irq(rq, &rf);
> - sched_preempt_enable_no_resched();
The point of this is if an interrupt triggers here and NEED_RESCHED is
set, then it will call schedule and possibly schedule out the task.
When it gets scheduled back in, the first thing it will do is to call
schedule again. The above code you deleted removes the spurious
schedule.
-- Steve
>
> schedule();
> }
Powered by blists - more mailing lists