Re: cond_resched() and RCU CPU stall warnings

2014-03-18 Thread Paul E. McKenney
On Tue, Mar 18, 2014 at 02:45:34PM +0100, Peter Zijlstra wrote: > > sched,rcu: Make cond_resched() report RCU quiescent states > > > > Given a CPU running a loop containing cond_resched(), with no > > other tasks runnable on that CPU, RCU will eventually report RCU > > CPU stall warnings due to la

Re: cond_resched() and RCU CPU stall warnings

2014-03-18 Thread Peter Zijlstra
> sched,rcu: Make cond_resched() report RCU quiescent states > > Given a CPU running a loop containing cond_resched(), with no > other tasks runnable on that CPU, RCU will eventually report RCU > CPU stall warnings due to lack of quiescent states. Fortunately, > every call to cond_resched() is a

Re: cond_resched() and RCU CPU stall warnings

2014-03-18 Thread Paul E. McKenney
On Tue, Mar 18, 2014 at 09:51:18AM +0100, Peter Zijlstra wrote: > On Mon, Mar 17, 2014 at 07:17:06PM -0700, Paul E. McKenney wrote: > > On Mon, Mar 17, 2014 at 06:14:34PM +0100, Peter Zijlstra wrote: > > > On Mon, Mar 17, 2014 at 09:58:07AM -0700, Paul E. McKenney wrote: > > > > @@ -4111,6 +4115,7

Re: cond_resched() and RCU CPU stall warnings

2014-03-18 Thread Peter Zijlstra
On Mon, Mar 17, 2014 at 07:17:06PM -0700, Paul E. McKenney wrote: > On Mon, Mar 17, 2014 at 06:14:34PM +0100, Peter Zijlstra wrote: > > On Mon, Mar 17, 2014 at 09:58:07AM -0700, Paul E. McKenney wrote: > > > @@ -4111,6 +4115,7 @@ int __sched __cond_resched_softirq(void) > > > { > > > BUG_ON(!in_

Re: cond_resched() and RCU CPU stall warnings

2014-03-17 Thread Paul E. McKenney
On Mon, Mar 17, 2014 at 06:14:34PM +0100, Peter Zijlstra wrote: > On Mon, Mar 17, 2014 at 09:58:07AM -0700, Paul E. McKenney wrote: > > @@ -4111,6 +4115,7 @@ int __sched __cond_resched_softirq(void) > > { > > BUG_ON(!in_softirq()); > > > > + rcu_cond_resched(); > > Don't you have to enabl

Re: cond_resched() and RCU CPU stall warnings

2014-03-17 Thread Peter Zijlstra
On Mon, Mar 17, 2014 at 09:58:07AM -0700, Paul E. McKenney wrote: > @@ -4111,6 +4115,7 @@ int __sched __cond_resched_softirq(void) > { > BUG_ON(!in_softirq()); > > + rcu_cond_resched(); Don't you have to enable BHs before doing that? And if not; that needs a comment for sure! :-) >

Re: cond_resched() and RCU CPU stall warnings

2014-03-17 Thread Paul E. McKenney
On Mon, Mar 17, 2014 at 11:13:00AM +0100, Peter Zijlstra wrote: > On Sat, Mar 15, 2014 at 06:59:14PM -0700, Paul E. McKenney wrote: > > So I have been tightening up rcutorture a bit over the past year. > > The other day, I came across what looked like a great opportunity for > > further tightening,

Re: cond_resched() and RCU CPU stall warnings

2014-03-17 Thread Peter Zijlstra
On Sat, Mar 15, 2014 at 06:59:14PM -0700, Paul E. McKenney wrote: > So I have been tightening up rcutorture a bit over the past year. > The other day, I came across what looked like a great opportunity for > further tightening, namely the schedule() in rcu_torture_reader(). > Why not turn this into

Re: cond_resched() and RCU CPU stall warnings

2014-03-16 Thread Mike Galbraith
On Sat, 2014-03-15 at 23:25 -0700, Paul E. McKenney wrote: > On Sun, Mar 16, 2014 at 07:09:42AM +0100, Mike Galbraith wrote: > > Hm. Since you only care about the case where your task is solo, how > > about do racy checks, 100% accuracy isn't required is it? Seems you > > wouldn't want to uncon

Re: cond_resched() and RCU CPU stall warnings

2014-03-15 Thread Paul E. McKenney
On Sun, Mar 16, 2014 at 07:14:15AM +0100, Mike Galbraith wrote: > On Sun, 2014-03-16 at 07:09 +0100, Mike Galbraith wrote: > > On Sat, 2014-03-15 at 18:59 -0700, Paul E. McKenney wrote: > > > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > > > index b46131ef6aab..994d2b0fd0b2 100644 >

Re: cond_resched() and RCU CPU stall warnings

2014-03-15 Thread Paul E. McKenney
On Sun, Mar 16, 2014 at 07:09:42AM +0100, Mike Galbraith wrote: > On Sat, 2014-03-15 at 18:59 -0700, Paul E. McKenney wrote: > > So I have been tightening up rcutorture a bit over the past year. > > The other day, I came across what looked like a great opportunity for > > further tightening, namel

Re: cond_resched() and RCU CPU stall warnings

2014-03-15 Thread Mike Galbraith
On Sun, 2014-03-16 at 07:09 +0100, Mike Galbraith wrote: > On Sat, 2014-03-15 at 18:59 -0700, Paul E. McKenney wrote: > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > > index b46131ef6aab..994d2b0fd0b2 100644 > > --- a/kernel/sched/core.c > > +++ b/kernel/sched/core.c > > @@ -4075,6

Re: cond_resched() and RCU CPU stall warnings

2014-03-15 Thread Mike Galbraith
On Sat, 2014-03-15 at 18:59 -0700, Paul E. McKenney wrote: > So I have been tightening up rcutorture a bit over the past year. > The other day, I came across what looked like a great opportunity for > further tightening, namely the schedule() in rcu_torture_reader(). > Why not turn this into a con

cond_resched() and RCU CPU stall warnings

2014-03-15 Thread Paul E. McKenney
So I have been tightening up rcutorture a bit over the past year. The other day, I came across what looked like a great opportunity for further tightening, namely the schedule() in rcu_torture_reader(). Why not turn this into a cond_resched(), speeding up the readers a bit and placing more stress o