Re: [PATCH] cfg80211: Pass lockdep expression to RCU lists

3 messages, 3 authors, 2020-02-19 · open the first message on its own page

Re: [PATCH] cfg80211: Pass lockdep expression to RCU lists

From: Johannes Berg <johannes@sipsolutions.net>
Date: 2020-02-19 09:13:48

On Wed, 2020-02-19 at 14:41 +0530, Amol Grover wrote:
 
-	WARN_ON_ONCE(!rcu_read_lock_held() && !lockdep_rtnl_is_held());
-
-	list_for_each_entry_rcu(pos, &rdev->sched_scan_req_list, list) {
+	list_for_each_entry_rcu(pos, &rdev->sched_scan_req_list, list,
+				lockdep_rtnl_is_held()) {
Huh, I didn't even know you _could_ do that :)

johannes

Re: [PATCH] cfg80211: Pass lockdep expression to RCU lists

From: "Paul E. McKenney" <paulmck@kernel.org>
Date: 2020-02-19 12:47:15

On Wed, Feb 19, 2020 at 10:13:36AM +0100, Johannes Berg wrote:
On Wed, 2020-02-19 at 14:41 +0530, Amol Grover wrote:
quoted
 
-	WARN_ON_ONCE(!rcu_read_lock_held() && !lockdep_rtnl_is_held());
-
-	list_for_each_entry_rcu(pos, &rdev->sched_scan_req_list, list) {
+	list_for_each_entry_rcu(pos, &rdev->sched_scan_req_list, list,
+				lockdep_rtnl_is_held()) {
Huh, I didn't even know you _could_ do that :)
It is a fairly recent addition, courtesy of Joel Fernandes.  ;-)

							Thanx, Paul

Re: [PATCH] cfg80211: Pass lockdep expression to RCU lists

From: Arend Van Spriel <arend.vanspriel@broadcom.com>
Date: 2020-02-19 21:27:48

On 2/19/2020 10:13 AM, Johannes Berg wrote:
On Wed, 2020-02-19 at 14:41 +0530, Amol Grover wrote:
quoted
  
-	WARN_ON_ONCE(!rcu_read_lock_held() && !lockdep_rtnl_is_held());
-
-	list_for_each_entry_rcu(pos, &rdev->sched_scan_req_list, list) {
+	list_for_each_entry_rcu(pos, &rdev->sched_scan_req_list, list,
+				lockdep_rtnl_is_held()) {
Huh, I didn't even know you _could_ do that :)
Me neither ;-). Above you are removing the WARN_ON_ONCE() entirely. 
Would it not be good to keep the WARN_ON_ONCE() with only the 
!rcu_read_lock_held() check.

Regards,
Arend
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help