mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org, mingo@kernel.org,
	jiangshanlai@gmail.com, dipankar@in.ibm.com,
	akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
	josh@joshtriplett.org, tglx@linutronix.de, rostedt@goodmis.org,
	dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com,
	oleg@redhat.com
Subject: Re: [PATCH tip/core/rcu 1/4] sched,rcu: Make cond_resched() provide RCU quiescent state
Date: Thu, 5 Oct 2017 08:11:12 -0700	[thread overview]
Message-ID: <20171005151112.GR3521@linux.vnet.ibm.com> (raw)
In-Reply-To: <20171005104051.shazuwnqbqjj3be2@hirez.programming.kicks-ass.net>

On Thu, Oct 05, 2017 at 12:40:51PM +0200, Peter Zijlstra wrote:
> On Wed, Oct 04, 2017 at 02:50:22PM -0700, Paul E. McKenney wrote:
> > diff --git a/include/linux/sched.h b/include/linux/sched.h
> > index 26a7df4e558c..59688ef3ea23 100644
> > --- a/include/linux/sched.h
> > +++ b/include/linux/sched.h
> > @@ -1565,10 +1565,11 @@ static inline int test_tsk_need_resched(struct task_struct *tsk)
> >   * cond_resched_lock() will drop the spinlock before scheduling,
> >   * cond_resched_softirq() will enable bhs before scheduling.
> >   */
> > +void rcu_all_qs(void);
> >  #ifndef CONFIG_PREEMPT
> >  extern int _cond_resched(void);
> >  #else
> > -static inline int _cond_resched(void) { return 0; }
> > +static inline int _cond_resched(void) { rcu_all_qs(); return 0; }
> >  #endif
> 
> Why does it need to change PREEMPT? the whole cond_resched() thing
> should be a no-op on PREEMPT.

Let's see...  Clearly for RCU-preempt, there is no need.  And you are
quite right, if rcu_read_lock_bh() or rcu_read_lock_sched() are preventing
a CPU from context switching, invoking cond_resched() on that CPU would
be a bug anyway.

I will drop this hunk, thank you!

							Thanx, Paul

  reply	other threads:[~2017-10-05 15:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-04 21:50 [PATCH tip/core/rcu 0/4] RCU CPU stall warning updates for v4.15 Paul E. McKenney
2017-10-04 21:50 ` [PATCH tip/core/rcu 1/4] sched,rcu: Make cond_resched() provide RCU quiescent state Paul E. McKenney
2017-10-05 10:40   ` Peter Zijlstra
2017-10-05 15:11     ` Paul E. McKenney [this message]
2017-10-04 21:50 ` [PATCH tip/core/rcu 2/4] rcu: Make RCU CPU stall warnings check for irq-disabled CPUs Paul E. McKenney
2017-10-04 21:50 ` [PATCH tip/core/rcu 3/4] rcu: Turn off tracing before dumping trace Paul E. McKenney
2017-10-04 21:50 ` [PATCH tip/core/rcu 4/4] rcu: Suppress RCU CPU stall warnings while " Paul E. McKenney

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=20171005151112.GR3521@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=edumazet@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jiangshanlai@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --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