Skip to contentSkip to conversation

udp: keep the sk_receive_queue held when splicing

PATCH Paolo Abeni 1 participant 1 message May 15, 2017 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Paolo Abeni

author maintainer
#1 lore raw
In reply to a message not in the archive
Quoted 18 lines · Eric Dumazet
Quoted 17 lines · Paolo Abeni

On packet reception, when we are forced to splice the sk_receive_queue, we can keep the related lock held, so that we can avoid re-acquiring it, if fwd memory scheduling is required.

---
 net/ipv4/udp.c | 36 ++++++++++++++++++++++++++----------
 1 file changed, 26 insertions(+), 10 deletions(-)
net/ipv4/udp.c +0 -0
index 492c76b..d698973 100644
@@ -1164,7 +1164,8 @@ int udp_sendpage(struct sock *sk, struct page *page, int offset,
 }
 
Quoted 6 lines

net/ipv4/udp.c int udp_sendpage(struct sock *sk, struct page *page, int offset, · line 1168

Quoted 4 lines
net/ipv4/udp.c +2 -1
 /* fully reclaim rmem/fwd memory allocated for skb */
-static void udp_rmem_release(struct sock *sk, int size, int partial)
+static void udp_rmem_release(struct sock *sk, int size, int partial,
+			     int rx_queue_lock_held)

Looks good, but please use a bool rx_queue_lock_held ?

oops, I wrongly omitted some most recipients in my initial reply, re- sending. Eric, I'm sorry for the duplicates.

ok, it sounds cleaner, I will submit a v2.

Thank you for reviewing this!

Cheers,

Paolo