Skip to content
  • Eric Dumazet's avatar
    fq_codel: add batch ability to fq_codel_drop() · 9d18562a
    Eric Dumazet authored
    
    
    In presence of inelastic flows and stress, we can call
    fq_codel_drop() for every packet entering fq_codel qdisc.
    
    fq_codel_drop() is quite expensive, as it does a linear scan
    of 4 KB of memory to find a fat flow.
    Once found, it drops the oldest packet of this flow.
    
    Instead of dropping a single packet, try to drop 50% of the backlog
    of this fat flow, with a configurable limit of 64 packets per round.
    
    TCA_FQ_CODEL_DROP_BATCH_SIZE is the new attribute to make this
    limit configurable.
    
    With this strategy the 4 KB search is amortized to a single cache line
    per drop [1], so fq_codel_drop() no longer appears at the top of kernel
    profile in presence of few inelastic flows.
    
    [1] Assuming a 64byte cache line, and 1024 buckets
    
    Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
    Reported-by: default avatarDave Taht <dave.taht@gmail.com>
    Cc: Jonathan Morton <chromatix99@gmail.com>
    Acked-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
    Acked-by: Dave Taht
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    9d18562a