Skip to content

Commit 0d4a660

Browse files
Paolo Abenidavem330
authored andcommitted
udp: do rmem bulk free even if the rx sk queue is empty
The commit 6b229cf ("udp: add batching to udp_rmem_release()") reduced greatly the cacheline contention between the BH and the US reader batching the rmem updates in most scenarios. Such optimization is explicitly avoided if the US reader is faster then BH processing. My fault, I initially suggested this kind of behavior due to concerns of possible regressions with small sk_rcvbuf values. Tests showed such concerns are misplaced, so this commit relaxes the condition for rmem bulk updates, obtaining small but measurable performance gain in the scenario described above. Signed-off-by: Paolo Abeni <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 186b3c9 commit 0d4a660

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

net/ipv4/udp.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,8 +1212,7 @@ static void udp_rmem_release(struct sock *sk, int size, int partial,
12121212
if (likely(partial)) {
12131213
up->forward_deficit += size;
12141214
size = up->forward_deficit;
1215-
if (size < (sk->sk_rcvbuf >> 2) &&
1216-
!skb_queue_empty(&up->reader_queue))
1215+
if (size < (sk->sk_rcvbuf >> 2))
12171216
return;
12181217
} else {
12191218
size += up->forward_deficit;

0 commit comments

Comments
 (0)