Skip to contentSkip to conversation

ipvlan: do not use cond_resched_rcu() in ipvlan_process_multicast()

PATCH Applied Eric Dumazet 3 participants 3 messages Mar 10, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipvlan: do not use cond_resched_rcu() in ipvlan_process_multicast()

Commit e18b353f102e ("ipvlan: add cond_resched_rcu() while processing muticast backlog") added a cond_resched_rcu() in a loop using rcu protection to iterate over slaves.

This is breaking rcu rules, so lets instead use cond_resched() at a point we can reschedule

Fixes e18b353f102e ("ipvlan: add cond_resched_rcu() while processing muticast backlog")
Cc Mahesh Bandewar <[email protected]>
---
 drivers/net/ipvlan/ipvlan_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ipvlan/ipvlan_core.c +1 -1
index 5759e91dec7105cb6d27ce8b4e47eae26f711ad5..8801d093135c3e72ca22643a8fbc7bf896727e4b 100644
@@ -277,7 +277,6 @@ void ipvlan_process_multicast(struct work_struct *work)
 			}
 			ipvlan_count_rx(ipvlan, len, ret == NET_RX_SUCCESS, true);
 			local_bh_enable();
-			cond_resched_rcu();
 		}
 		rcu_read_unlock();
 
@@ -294,6 +293,7 @@ void ipvlan_process_multicast(struct work_struct *work)
 		}
 		if (dev)
 			dev_put(dev);
+		cond_resched();
 	}
 }
 
Signature · 1 line
2.25.1.481.gfbce0eb801-goog
maintainer Applied
#1 lore raw

From: Eric Dumazet <[email protected]>
Date: Mon, 9 Mar 2020 18:22:58 -0700

Quoted 10 lines

Commit e18b353f102e ("ipvlan: add cond_resched_rcu() while processing muticast backlog") added a cond_resched_rcu() in a loop using rcu protection to iterate over slaves.

This is breaking rcu rules, so lets instead use cond_resched() at a point we can reschedule

Fixes e18b353f102e ("ipvlan: add cond_resched_rcu() while processing muticast backlog")
Cc Mahesh Bandewar <[email protected]>

Applied, thanks for the quick fix Eric.

#2 lore raw
Quoted 7 lines · David Miller

From: Eric Dumazet <[email protected]>
Date: Mon, 9 Mar 2020 18:22:58 -0700

Quoted 4 lines

Commit e18b353f102e ("ipvlan: add cond_resched_rcu() while processing muticast backlog") added a cond_resched_rcu() in a loop using rcu protection to iterate over slaves.

Quoted 9 lines
Quoted 6 lines

This is breaking rcu rules, so lets instead use cond_resched() at a point we can reschedule

Fixes e18b353f102e ("ipvlan: add cond_resched_rcu() while processing muticast backlog")
Cc Mahesh Bandewar <[email protected]>

Applied, thanks for the quick fix Eric.

Sure thing ;)