浏览代码

udp: do rmem bulk free even if the rx sk queue is empty

The commit 6b229cf77d68 ("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 <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Paolo Abeni 8 年之前
父节点
当前提交
0d4a6608f6
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      net/ipv4/udp.c

+ 1 - 2
net/ipv4/udp.c

@@ -1212,8 +1212,7 @@ static void udp_rmem_release(struct sock *sk, int size, int partial,
 	if (likely(partial)) {
 	if (likely(partial)) {
 		up->forward_deficit += size;
 		up->forward_deficit += size;
 		size = up->forward_deficit;
 		size = up->forward_deficit;
-		if (size < (sk->sk_rcvbuf >> 2) &&
-		    !skb_queue_empty(&up->reader_queue))
+		if (size < (sk->sk_rcvbuf >> 2))
 			return;
 			return;
 	} else {
 	} else {
 		size += up->forward_deficit;
 		size += up->forward_deficit;