[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230815224233.GD602899@lorien.usersys.redhat.com>
Date: Tue, 15 Aug 2023 18:42:33 -0400
From: Phil Auld <pauld@...hat.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: bigeasy@...utronix.de, tglx@...utronix.de,
linux-kernel@...r.kernel.org, bsegall@...gle.com,
boqun.feng@...il.com, swood@...hat.com, bristot@...hat.com,
dietmar.eggemann@....com, mingo@...hat.com, jstultz@...gle.com,
juri.lelli@...hat.com, mgorman@...e.de, rostedt@...dmis.org,
vschneid@...hat.com, vincent.guittot@...aro.org,
longman@...hat.com, will@...nel.org
Subject: Re: [PATCH 3/6] sched: Extract __schedule_loop()
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@...utronix.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@...utronix.de>
> > Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.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.
>
Using this command:
ps -Ao pid,f,fname,s,wchan
> 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 -
>
> vs
>
> 10417 1 kworker/ I worker_thread
> 10665 1 kworker/ I worker_thread
> 10670 4 sshd D -
> 10674 4 bash S do_wait
> 10701 0 sleep S hrtimer_nanosleep
> 10702 4 ps R -
>
> Otherwise, looking forward to getting this and the rest of RT in...
>
> Cheers,
> Phil
>
> > {
> > - struct task_struct *tsk = current;
> > -
> > - sched_submit_work(tsk);
> > do {
> > preempt_disable();
> > - __schedule(SM_NONE);
> > + __schedule(sched_mode);
> > sched_preempt_enable_no_resched();
> > } while (need_resched());
> > +}
> > +
> > +asmlinkage __visible void __sched schedule(void)
> > +{
> > + struct task_struct *tsk = current;
> > +
> > + sched_submit_work(tsk);
> > + __schedule_loop(SM_NONE);
> > sched_update_worker(tsk);
> > }
> > EXPORT_SYMBOL(schedule);
> > @@ -6860,11 +6865,7 @@ void __sched schedule_preempt_disabled(v
> > #ifdef CONFIG_PREEMPT_RT
> > void __sched notrace schedule_rtlock(void)
> > {
> > - do {
> > - preempt_disable();
> > - __schedule(SM_RTLOCK_WAIT);
> > - sched_preempt_enable_no_resched();
> > - } while (need_resched());
> > + __schedule_loop(SM_RTLOCK_WAIT);
> > }
> > NOKPROBE_SYMBOL(schedule_rtlock);
> > #endif
> >
> >
>
> --
>
--
Powered by blists - more mailing lists