• Eric Dumazet's avatar
    net: minor optimization in __alloc_skb() · c2dd4059
    Eric Dumazet authored
    TCP allocates 'fast clones' skbs for packets in tx queues.
    
    Currently, __alloc_skb() initializes the companion fclone
    field to SKB_FCLONE_CLONE, and leaves other fields untouched.
    
    It makes sense to defer this init much later in skb_clone(),
    because all fclone fields are copied and hot in cpu caches
    at that time.
    
    This removes one cache line miss in __alloc_skb(), cost seen
    on an host with 256 cpus all competing on memory accesses.
    Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    c2dd4059
skbuff.c 162 KB