Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1559929

Re: [PATCH tip/core/rcu 11/20] sched,rcu: Make cond_resched() provide RCU quiescent state

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH tip/core/rcu 11/20] sched,rcu: Make cond_resched() provide RCU quiescent state
Date 2017-01-16 18:20 +0100
Message-ID <t0j6O-3rL-19@gated-at.bofh.it> (permalink)
References <sZsFb-49R-5@gated-at.bofh.it> <sZsFc-49R-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, Jan 14, 2017 at 01:13:12AM -0800, Paul E. McKenney wrote:
> There is some confusion as to which of cond_resched() or
> cond_resched_rcu_qs() should be added to long in-kernel loops.
> This commit therefore eliminates the decision by adding RCU
> quiescent states to cond_resched().

Which would make: rcu_read_lock(); cond_resched(); rcu_read_unlock();
invalid under preemptible RCU. Is it already?

> Warning: This is a prototype.  For example, it does not correctly
> handle Tasks RCU.  Which is OK for the moment, given that no one
> actually uses Tasks RCU yet.

> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -4907,6 +4907,7 @@ int __sched _cond_resched(void)
>  		preempt_schedule_common();
>  		return 1;
>  	}
> +	rcu_all_qs();
>  	return 0;
>  }

Still not a real fan of this, it does make cond_resched() touch a bunch
more cachelines, also, I suppose that if we're going to do this, we
should make __cond_resched_lock() and __cond_resched_softirq() act
similarly.

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH tip/core/rcu 11/20] sched,rcu: Make cond_resched() provide RCU quiescent state "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-14 10:20 +0100
  Re: [PATCH tip/core/rcu 11/20] sched,rcu: Make cond_resched()  provide RCU quiescent state Josh Triplett <josh@joshtriplett.org> - 2017-01-16 09:10 +0100
    Re: [PATCH tip/core/rcu 11/20] sched,rcu: Make cond_resched()  provide RCU quiescent state "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-16 12:40 +0100
  Re: [PATCH tip/core/rcu 11/20] sched,rcu: Make cond_resched()  provide RCU quiescent state Peter Zijlstra <peterz@infradead.org> - 2017-01-16 18:20 +0100
    Re: [PATCH tip/core/rcu 11/20] sched,rcu: Make cond_resched()  provide RCU quiescent state "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-17 05:00 +0100
      Re: [PATCH tip/core/rcu 11/20] sched,rcu: Make cond_resched()  provide RCU quiescent state Michal Hocko <mhocko@kernel.org> - 2017-01-17 12:10 +0100
        Re: [PATCH tip/core/rcu 11/20] sched,rcu: Make cond_resched()  provide RCU quiescent state "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-17 13:10 +0100
          Re: [PATCH tip/core/rcu 11/20] sched,rcu: Make cond_resched()  provide RCU quiescent state Michal Hocko <mhocko@kernel.org> - 2017-01-17 13:20 +0100
            Re: [PATCH tip/core/rcu 11/20] sched,rcu: Make cond_resched()  provide RCU quiescent state "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-18 08:20 +0100

csiph-web