Re: [PATCH 3/6] sched: Extract __schedule_loop()

Peter Zijlstra
2023-08-15T22:40:32Z

On Tue, Aug 15, 2023 at 06:33:01PM -0400, Phil Auld wrote:
> Hi Peter,
>
> On Tue, Aug 15, 2023 at 01:01:24PM +0200 Peter Zijlstra wrote:
> > From: Thomas Gleixner <tglx@linutronix.de>
> >
> > There are currently two implementations of this basic __schedule()
> > loop, and there is soon to be a third.
> >
> > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > Link: https://lkml.kernel.org/r/20230427111937.2745231-2-bigeasy@linutronix.de
> > ---
> > kernel/sched/core.c | 21 +++++++++++----------
> > 1 file changed, 11 insertions(+), 10 deletions(-)
> >
> > --- a/kernel/sched/core.c
> > +++ b/kernel/sched/core.c
> > @@ -6787,16 +6787,21 @@ static void sched_update_worker(struct t
> > }
> > }
> >
> > -asmlinkage __visible void __sched schedule(void)
> > +static __always_inline void __schedule_loop(unsigned int sched_mode)
>
> I think this needs __sched or it's the only thing that ever shows up
> in wchan. E.g.
>
> 16995 0 bash S __schedule_loop.constprop.0
> 17036 1 kworker/ I __schedule_loop.constprop.0
> 17151 1 kworker/ I __schedule_loop.constprop.0
> 17235 0 sleep S __schedule_loop.constprop.0
> 17236 4 ps R -

But but but __always_inline... ?!?