From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
LKML <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH v2] sched: Have do_idle() call __schedule() without enabling preemption
Date: Wed, 12 Apr 2017 17:50:23 -0700 [thread overview]
Message-ID: <20170413005023.GT3956@linux.vnet.ibm.com> (raw)
In-Reply-To: <20170412204000.3c6893eb@gandalf.local.home>
On Wed, Apr 12, 2017 at 08:40:00PM -0400, Steven Rostedt wrote:
> On Wed, 12 Apr 2017 16:48:59 -0700
> "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> wrote:
> >
> > I don't understand why schedule_idle() needs a loop given that
> > schedule_preempt_disabled() doesn't have one, but other than
>
> But it does:
>
> void __sched schedule_preempt_disabled(void)
> {
> sched_preempt_enable_no_resched();
> schedule();
> preempt_disable();
> }
>
> Where we have:
>
> asmlinkage __visible void __sched schedule(void)
> {
> struct task_struct *tsk = current;
>
> sched_submit_work(tsk);
> do {
> preempt_disable();
> __schedule(false);
> sched_preempt_enable_no_resched();
> } while (need_resched());
> }
>
> Which makes:
>
> void __sched schedule_preempt_disabled(void)
> {
> struct task_struct *tsk = current;
>
> scehdule_preempt_enable_no_resched();
> sched_submit_work(tsk);
> do {
> preempt_disable();
> __schedule(false);
> schedule_preempt_enable_no_resched();
> } while (need_resched());
> preempt_disable();
> }
>
> My schedule_idle() is simply schedule_preempt_disabled() without the
> change in preemption and no call to sched_submit_work().
Ah, thank you!
> > that, for whatever it is worth, it looks good to me.
>
> Does this mean I can change the Cc: to Acked-by: ?
Works for me!
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> -- Steve
>
>
> > > +void __sched schedule_idle(void)
> > > +{
> > > + do {
> > > + __schedule(false);
> > > + } while (need_resched());
> > > +}
> > > +
>
next prev parent reply other threads:[~2017-04-13 0:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-12 18:27 Steven Rostedt
2017-04-12 18:32 ` Steven Rostedt
2017-04-12 23:48 ` Paul E. McKenney
2017-04-13 0:40 ` Steven Rostedt
2017-04-13 0:50 ` Paul E. McKenney [this message]
2017-04-13 8:44 ` Peter Zijlstra
2017-04-13 13:48 ` Steven Rostedt
2017-04-13 14:38 ` Peter Zijlstra
2017-04-13 14:54 ` Steven Rostedt
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=20170413005023.GT3956@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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
Powered by JetHome