udp: add batching to udp_rmem_release()
If udp_recvmsg() constantly releases sk_rmem_alloc for every read packet, it gives opportunity for producers to immediately grab spinlocks and desperatly try adding another packet, causing false sharing. We can add a simple heuristic to give the signal by batches of ~25 % of the queue capacity. This patch considerably increases performance under flood by about 50 %, since the thread draining the queue is no longer slowed by false sharing. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

کامیت شده توسط
David S. Miller

والد
c84d949057
کامیت
6b229cf77d
@@ -79,6 +79,9 @@ struct udp_sock {
|
||||
int (*gro_complete)(struct sock *sk,
|
||||
struct sk_buff *skb,
|
||||
int nhoff);
|
||||
|
||||
/* This field is dirtied by udp_recvmsg() */
|
||||
int forward_deficit;
|
||||
};
|
||||
|
||||
static inline struct udp_sock *udp_sk(const struct sock *sk)
|
||||
|
مرجع در شماره جدید
Block a user