]> git.baikalelectronics.ru Git - kernel.git/commit
net: avoid one atomic operation in skb_clone()
authorEric Dumazet <edumazet@google.com>
Wed, 1 Oct 2014 22:27:15 +0000 (15:27 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 2 Oct 2014 01:27:23 +0000 (21:27 -0400)
commit5627d39b30f9966580216f6c02ff6c5c3e21f367
tree5efaaa29736600ab06f5c4ed27af855fb543de13
parentdab91303e804f0273132d871101feeefa817c8f3
net: avoid one atomic operation in skb_clone()

Fast clone cloning can actually avoid an atomic_inc(), if we
guarantee prior clone_ref value is 1.

This requires a change kfree_skbmem(), to perform the
atomic_dec_and_test() on clone_ref before setting fclone to
SKB_FCLONE_UNAVAILABLE.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/skbuff.c