Re: [PATCH v1 1/6] rcu: Add support for consolidated-RCU reader checking

2019-07-12 Thread Paul E. McKenney
On Fri, Jul 12, 2019 at 03:40:40PM -0400, Joel Fernandes wrote: > On Fri, Jul 12, 2019 at 10:46:30AM -0700, Paul E. McKenney wrote: > > On Fri, Jul 12, 2019 at 01:06:31PM -0400, Joel Fernandes wrote: > > > On Fri, Jul 12, 2019 at 09:45:31AM -0700, Paul E. McKenney wrote: > > > > On Fri, Jul 12, 201

Re: [PATCH v1 1/6] rcu: Add support for consolidated-RCU reader checking

2019-07-12 Thread Joel Fernandes
On Fri, Jul 12, 2019 at 10:46:30AM -0700, Paul E. McKenney wrote: > On Fri, Jul 12, 2019 at 01:06:31PM -0400, Joel Fernandes wrote: > > On Fri, Jul 12, 2019 at 09:45:31AM -0700, Paul E. McKenney wrote: > > > On Fri, Jul 12, 2019 at 11:10:51AM -0400, Joel Fernandes wrote: > > > > On Fri, Jul 12, 201

Re: [PATCH v1 1/6] rcu: Add support for consolidated-RCU reader checking

2019-07-12 Thread Paul E. McKenney
On Fri, Jul 12, 2019 at 01:06:31PM -0400, Joel Fernandes wrote: > On Fri, Jul 12, 2019 at 09:45:31AM -0700, Paul E. McKenney wrote: > > On Fri, Jul 12, 2019 at 11:10:51AM -0400, Joel Fernandes wrote: > > > On Fri, Jul 12, 2019 at 01:11:25PM +0200, Peter Zijlstra wrote: > > > > On Thu, Jul 11, 2019

Re: [PATCH v1 1/6] rcu: Add support for consolidated-RCU reader checking

2019-07-12 Thread Joel Fernandes
On Fri, Jul 12, 2019 at 09:45:31AM -0700, Paul E. McKenney wrote: > On Fri, Jul 12, 2019 at 11:10:51AM -0400, Joel Fernandes wrote: > > On Fri, Jul 12, 2019 at 01:11:25PM +0200, Peter Zijlstra wrote: > > > On Thu, Jul 11, 2019 at 07:43:56PM -0400, Joel Fernandes (Google) wrote: > > > > +int rcu_rea

Re: [PATCH v1 1/6] rcu: Add support for consolidated-RCU reader checking

2019-07-12 Thread Paul E. McKenney
On Fri, Jul 12, 2019 at 11:10:51AM -0400, Joel Fernandes wrote: > On Fri, Jul 12, 2019 at 01:11:25PM +0200, Peter Zijlstra wrote: > > On Thu, Jul 11, 2019 at 07:43:56PM -0400, Joel Fernandes (Google) wrote: > > > +int rcu_read_lock_any_held(void) > > > +{ > > > + int lockdep_opinion = 0; > > > + >

Re: [PATCH v1 1/6] rcu: Add support for consolidated-RCU reader checking

2019-07-12 Thread Peter Zijlstra
On Fri, Jul 12, 2019 at 11:10:51AM -0400, Joel Fernandes wrote: > Agreed, I will do it this way (without the debug_locks) like: > > ---8<--- > > diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c > index ba861d1716d3..339aebc330db 100644 > --- a/kernel/rcu/update.c > +++ b

Re: [PATCH v1 1/6] rcu: Add support for consolidated-RCU reader checking

2019-07-12 Thread Joel Fernandes
On Fri, Jul 12, 2019 at 01:11:25PM +0200, Peter Zijlstra wrote: > On Thu, Jul 11, 2019 at 07:43:56PM -0400, Joel Fernandes (Google) wrote: > > +int rcu_read_lock_any_held(void) > > +{ > > + int lockdep_opinion = 0; > > + > > + if (!debug_lockdep_rcu_enabled()) > > + return 1; > > +

Re: [PATCH v1 1/6] rcu: Add support for consolidated-RCU reader checking

2019-07-12 Thread Joel Fernandes
On Fri, Jul 12, 2019 at 01:01:42PM +0200, Peter Zijlstra wrote: > On Thu, Jul 11, 2019 at 07:43:56PM -0400, Joel Fernandes (Google) wrote: > > This patch adds support for checking RCU reader sections in list > > traversal macros. Optionally, if the list macro is called under SRCU or > > other lock/

Re: [PATCH v1 1/6] rcu: Add support for consolidated-RCU reader checking

2019-07-12 Thread Joel Fernandes
On Fri, Jul 12, 2019 at 02:12:00PM +0200, Oleg Nesterov wrote: > On 07/11, Joel Fernandes (Google) wrote: > > > > +int rcu_read_lock_any_held(void) > > rcu_sync_is_idle() wants it. You have my ack in advance ;) Cool, thanks ;) - Joel

Re: [PATCH v1 1/6] rcu: Add support for consolidated-RCU reader checking

2019-07-12 Thread Oleg Nesterov
On 07/11, Joel Fernandes (Google) wrote: > > +int rcu_read_lock_any_held(void) rcu_sync_is_idle() wants it. You have my ack in advance ;) Oleg.

Re: [PATCH v1 1/6] rcu: Add support for consolidated-RCU reader checking

2019-07-12 Thread Peter Zijlstra
On Thu, Jul 11, 2019 at 07:43:56PM -0400, Joel Fernandes (Google) wrote: > +int rcu_read_lock_any_held(void) > +{ > + int lockdep_opinion = 0; > + > + if (!debug_lockdep_rcu_enabled()) > + return 1; > + if (!rcu_is_watching()) > + return 0; > + if (!rcu_lockd

Re: [PATCH v1 1/6] rcu: Add support for consolidated-RCU reader checking

2019-07-12 Thread Peter Zijlstra
On Thu, Jul 11, 2019 at 07:43:56PM -0400, Joel Fernandes (Google) wrote: > This patch adds support for checking RCU reader sections in list > traversal macros. Optionally, if the list macro is called under SRCU or > other lock/mutex protection, then appropriate lockdep expressions can be > passed t

Re: [PATCH v1 1/6] rcu: Add support for consolidated-RCU reader checking

2019-07-11 Thread Joel Fernandes
On Thu, Jul 11, 2019 at 07:43:56PM -0400, Joel Fernandes (Google) wrote: > This patch adds support for checking RCU reader sections in list > traversal macros. Optionally, if the list macro is called under SRCU or > other lock/mutex protection, then appropriate lockdep expressions can be > passed t

[PATCH v1 1/6] rcu: Add support for consolidated-RCU reader checking

2019-07-11 Thread Joel Fernandes (Google)
This patch adds support for checking RCU reader sections in list traversal macros. Optionally, if the list macro is called under SRCU or other lock/mutex protection, then appropriate lockdep expressions can be passed to make the checks pass. Existing list_for_each_entry_rcu() invocations don't nee