Re: [PATCH net-next] rcu: prevent RCU_LOCKDEP_WARN() from swallowing the condition

2020-09-15 Thread Paul E. McKenney
On Mon, Sep 14, 2020 at 05:30:29PM -0700, Jakub Kicinski wrote: > On Mon, 14 Sep 2020 17:20:11 -0700 Paul E. McKenney wrote: > > > Seems like quite a few places depend on the macro disappearing its > > > argument. I was concerned that it's going to be had to pick out whether > > > !LOCKDEP builds

Re: [PATCH net-next] rcu: prevent RCU_LOCKDEP_WARN() from swallowing the condition

2020-09-14 Thread Joel Fernandes
On Mon, Sep 14, 2020 at 03:47:38PM -0700, Jakub Kicinski wrote: > On Mon, 14 Sep 2020 16:21:22 -0400 Joel Fernandes wrote: > > On Tue, Sep 08, 2020 at 05:27:51PM -0700, Jakub Kicinski wrote: > > > On Tue, 08 Sep 2020 21:15:56 +0300 niko...@cumulusnetworks.com wrote: > > > > Ah, you want to solve

Re: [PATCH net-next] rcu: prevent RCU_LOCKDEP_WARN() from swallowing the condition

2020-09-14 Thread Jakub Kicinski
On Mon, 14 Sep 2020 17:20:11 -0700 Paul E. McKenney wrote: > > Seems like quite a few places depend on the macro disappearing its > > argument. I was concerned that it's going to be had to pick out whether > > !LOCKDEP builds should return true or false from LOCKDEP helpers, but > > perhaps

Re: [PATCH net-next] rcu: prevent RCU_LOCKDEP_WARN() from swallowing the condition

2020-09-14 Thread Paul E. McKenney
On Mon, Sep 14, 2020 at 03:47:38PM -0700, Jakub Kicinski wrote: > On Mon, 14 Sep 2020 16:21:22 -0400 Joel Fernandes wrote: > > On Tue, Sep 08, 2020 at 05:27:51PM -0700, Jakub Kicinski wrote: > > > On Tue, 08 Sep 2020 21:15:56 +0300 niko...@cumulusnetworks.com wrote: > > > > Ah, you want to solve

Re: [PATCH net-next] rcu: prevent RCU_LOCKDEP_WARN() from swallowing the condition

2020-09-14 Thread Jakub Kicinski
On Mon, 14 Sep 2020 16:21:22 -0400 Joel Fernandes wrote: > On Tue, Sep 08, 2020 at 05:27:51PM -0700, Jakub Kicinski wrote: > > On Tue, 08 Sep 2020 21:15:56 +0300 niko...@cumulusnetworks.com wrote: > > > Ah, you want to solve it for all. :) > > > Looks and sounds good to me, > > > Reviewed-by:

Re: [PATCH net-next] rcu: prevent RCU_LOCKDEP_WARN() from swallowing the condition

2020-09-14 Thread Joel Fernandes
On Tue, Sep 08, 2020 at 05:27:51PM -0700, Jakub Kicinski wrote: > On Tue, 08 Sep 2020 21:15:56 +0300 niko...@cumulusnetworks.com wrote: > > Ah, you want to solve it for all. :) > > Looks and sounds good to me, > > Reviewed-by: Nikolay Aleksandrov > > Actually, I give up, lockdep_is_held() is

Re: [PATCH net-next] rcu: prevent RCU_LOCKDEP_WARN() from swallowing the condition

2020-09-08 Thread David Miller
From: Jakub Kicinski Date: Tue, 8 Sep 2020 10:36:24 -0700 > We run into a unused variable warning in bridge code when > variable is only used inside the condition of > rcu_dereference_protected(). > > #define mlock_dereference(X, br) \ > rcu_dereference_protected(X,

Re: [PATCH net-next] rcu: prevent RCU_LOCKDEP_WARN() from swallowing the condition

2020-09-08 Thread Jakub Kicinski
On Tue, 08 Sep 2020 21:15:56 +0300 niko...@cumulusnetworks.com wrote: > Ah, you want to solve it for all. :) > Looks and sounds good to me, > Reviewed-by: Nikolay Aleksandrov Actually, I give up, lockdep_is_held() is not defined without CONFIG_LOCKDEP, let's just go with your patch..

Re: [PATCH net-next] rcu: prevent RCU_LOCKDEP_WARN() from swallowing the condition

2020-09-08 Thread nikolay
On 8 September 2020 20:36:24 EEST, Jakub Kicinski wrote: >We run into a unused variable warning in bridge code when >variable is only used inside the condition of >rcu_dereference_protected(). > > #define mlock_dereference(X, br) \ > rcu_dereference_protected(X,

[PATCH net-next] rcu: prevent RCU_LOCKDEP_WARN() from swallowing the condition

2020-09-08 Thread Jakub Kicinski
We run into a unused variable warning in bridge code when variable is only used inside the condition of rcu_dereference_protected(). #define mlock_dereference(X, br) \ rcu_dereference_protected(X, lockdep_is_held(>multicast_lock)) Since on builds with CONFIG_PROVE_RCU=n