public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Phil Auld <pauld@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: bigeasy@linutronix.de, tglx@linutronix.de,
	linux-kernel@vger.kernel.org, bsegall@google.com,
	boqun.feng@gmail.com, swood@redhat.com, bristot@redhat.com,
	dietmar.eggemann@arm.com, mingo@redhat.com, jstultz@google.com,
	juri.lelli@redhat.com, mgorman@suse.de, rostedt@goodmis.org,
	vschneid@redhat.com, vincent.guittot@linaro.org,
	longman@redhat.com, will@kernel.org
Subject: Re: [PATCH 3/6] sched: Extract __schedule_loop()
Date: Tue, 15 Aug 2023 18:42:33 -0400	[thread overview]
Message-ID: <20230815224233.GD602899@lorien.usersys.redhat.com> (raw)
In-Reply-To: <20230815223301.GC602899@lorien.usersys.redhat.com>

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.
>

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
> > 
> > 
> 
> -- 
> 

-- 


  parent reply	other threads:[~2023-08-15 22:43 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-15 11:01 [PATCH 0/6] locking/rtmutex: Avoid PI state recursion through sched_submit_work() Peter Zijlstra
2023-08-15 11:01 ` [PATCH 1/6] sched: Constrain locks in sched_submit_work() Peter Zijlstra
2023-08-15 11:01 ` [PATCH 2/6] locking/rtmutex: Avoid unconditional slowpath for DEBUG_RT_MUTEXES Peter Zijlstra
2023-08-15 11:01 ` [PATCH 3/6] sched: Extract __schedule_loop() Peter Zijlstra
2023-08-15 22:33   ` Phil Auld
2023-08-15 22:39     ` Peter Zijlstra
2023-08-16 14:14       ` Phil Auld
2023-08-15 22:42     ` Phil Auld [this message]
2023-08-16 10:01     ` Sebastian Andrzej Siewior
2023-08-16 11:39       ` Phil Auld
2023-08-16 12:20         ` Sebastian Andrzej Siewior
2023-08-16 12:48           ` Phil Auld
2023-08-15 11:01 ` [PATCH 4/6] sched: Provide rt_mutex specific scheduler helpers Peter Zijlstra
2023-08-15 11:01 ` [PATCH 5/6] locking/rtmutex: Use " Peter Zijlstra
2023-08-15 11:01 ` [PATCH 6/6] locking/rtmutex: Add a lockdep assert to catch potential nested blocking Peter Zijlstra
2023-08-15 16:15 ` [PATCH 0/6] locking/rtmutex: Avoid PI state recursion through sched_submit_work() Peter Zijlstra
2023-08-16  8:58   ` Sebastian Andrzej Siewior
2023-08-16  9:42     ` Peter Zijlstra
2023-08-16 10:19       ` Sebastian Andrzej Siewior
2023-08-16 13:46         ` Sebastian Andrzej Siewior
2023-08-16 14:58           ` Peter Zijlstra
2023-08-16 15:22             ` Peter Zijlstra
2023-08-16 15:25               ` Sebastian Andrzej Siewior
2023-08-17  6:59             ` Sebastian Andrzej Siewior
2023-08-17  8:26               ` Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230815224233.GD602899@lorien.usersys.redhat.com \
    --to=pauld@redhat.com \
    --cc=bigeasy@linutronix.de \
    --cc=boqun.feng@gmail.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=jstultz@google.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=swood@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox