From: Steven Rostedt <rostedt@goodmis.org>
To: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Byungchul Park <byungchul.park@lge.com>,
jiangshanlai@gmail.com, josh@joshtriplett.org,
mathieu.desnoyers@efficios.com, linux-kernel@vger.kernel.org,
kernel-team@lge.com, peterz@infradead.org
Subject: Re: [PATCH] rcu: Report a quiescent state when it's exactly in the state
Date: Fri, 11 May 2018 12:25:28 -0400 [thread overview]
Message-ID: <20180511122528.2a398d24@gandalf.local.home> (raw)
In-Reply-To: <20180511122321.722a12cc@gandalf.local.home>
On Fri, 11 May 2018 12:23:21 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> On Fri, 11 May 2018 09:17:46 -0700
> "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> wrote:
>
> > > >index ee8cf5fc..7432261 100644
> > > >--- a/include/linux/rcupdate.h
> > > >+++ b/include/linux/rcupdate.h
> > > >@@ -195,8 +195,8 @@ static inline void exit_tasks_rcu_finish(void) { }
> > > > */
> > > > #define cond_resched_tasks_rcu_qs() \
> > > > do { \
> > > >- if (!cond_resched()) \
> > > >- rcu_note_voluntary_context_switch_lite(current); \
> > > >+ rcu_note_voluntary_context_switch_lite(current); \
> > > >+ cond_resched(); \
> >
> > Ah, good point.
> >
> > Peter, I have to ask... Why is "cond_resched()" considered a preemption
> > while "schedule()" is not?
>
> I would argue that cond_resched() not be considered a preemption.
> Although, it may be called a "preemption point". A place that can be
> preempted, but may not be. Maybe that's the answer. schedule() will
> always schedule (even though it may pick the same task to run, but
> not guaranteed to), where as, cond_resched() will only schedule if the
> conditions are right. And maybe that's not really a "voluntary
> schedule", although I think that can be argued against.
>
I would also say that one should never call schedule() directly without
changing its state to something other than TASK_RUNNING. Hence, calling
schedule directly is saying you are ready to sleep. But that is not the
case with cond_resched() which should always be called with the state
as TASK_RUNNING.
-- Steve
next prev parent reply other threads:[~2018-05-11 16:25 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-11 8:30 [PATCH] rcu: Report a quiescent state when it's exactly in the state Byungchul Park
2018-05-11 12:57 ` Byungchul Park
2018-05-11 16:17 ` Paul E. McKenney
2018-05-11 16:23 ` Steven Rostedt
2018-05-11 16:25 ` Steven Rostedt [this message]
2018-05-11 16:27 ` Steven Rostedt
2018-05-11 17:27 ` Paul E. McKenney
2018-05-11 17:29 ` Steven Rostedt
2018-05-11 22:41 ` Joel Fernandes
2018-05-12 5:08 ` Paul E. McKenney
2018-05-12 6:30 ` Joel Fernandes
2018-05-12 14:41 ` Paul E. McKenney
2018-05-12 17:26 ` Steven Rostedt
2018-05-14 3:11 ` Byungchul Park
2018-05-13 0:09 ` Joel Fernandes
2018-05-14 2:59 ` Byungchul Park
2018-05-14 14:25 ` Byungchul Park
2018-05-14 21:04 ` Paul E. McKenney
2018-05-15 0:18 ` Byungchul Park
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=20180511122528.2a398d24@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=byungchul.park@lge.com \
--cc=jiangshanlai@gmail.com \
--cc=josh@joshtriplett.org \
--cc=kernel-team@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.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;
as well as URLs for NNTP newsgroup(s).