Skip to content
  • Eric Dumazet's avatar
    udp: add batching to udp_rmem_release() · 6b229cf7
    Eric Dumazet authored
    
    
    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: default avatarEric Dumazet <edumazet@google.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    6b229cf7