• John Fastabend's avatar
    net: sched: allow qdiscs to handle locking · 6b3ba914
    John Fastabend authored
    This patch adds a flag for queueing disciplines to indicate the stack
    does not need to use the qdisc lock to protect operations. This can
    be used to build lockless scheduling algorithms and improving
    performance.
    
    The flag is checked in the tx path and the qdisc lock is only taken
    if it is not set. For now use a conditional if statement. Later we
    could be more aggressive if it proves worthwhile and use a static key
    or wrap this in a likely().
    
    Also the lockless case drops the TCQ_F_CAN_BYPASS logic. The reason
    for this is synchronizing a qlen counter across threads proves to
    cost more than doing the enqueue/dequeue operations when tested with
    pktgen.
    Signed-off-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    6b3ba914
sch_generic.c 25.7 KB