• Eric Dumazet's avatar
    inetpeer: remove AVL implementation in favor of RB tree · b145425f
    Eric Dumazet authored
    As discussed in Faro during Netfilter Workshop 2017, RB trees can be
    used with RCU, using a seqlock.
    
    Note that net/rxrpc/conn_service.c is already using this.
    
    This patch converts inetpeer from AVL tree to RB tree, since it allows
    to remove private AVL implementation in favor of shared RB code.
    
    $ size net/ipv4/inetpeer.before net/ipv4/inetpeer.after
       text    data     bss     dec     hex filename
       3195      40     128    3363     d23 net/ipv4/inetpeer.before
       1562      24       0    1586     632 net/ipv4/inetpeer.after
    
    The same technique can be used to speed up
    net/netfilter/nft_set_rbtree.c (removing rwlock contention in fast path)
    Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    b145425f
inetpeer.c 8.13 KB