]> git.baikalelectronics.ru Git - kernel.git/commit
net: Update alloc frag to reduce get/put page usage and recycle pages
authorAlexander Duyck <alexander.h.duyck@intel.com>
Thu, 12 Jul 2012 14:23:50 +0000 (14:23 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 13 Jul 2012 12:48:36 +0000 (05:48 -0700)
commit3f5febdd121c9e6d630f30d8d0ebe5aca7f4909c
tree2217ac3c443baa30d63a02f321b61d762065dbdc
parent8fc748bf6346b227159c510a2107bc9d118953ca
net: Update alloc frag to reduce get/put page usage and recycle pages

This patch is meant to help improve performance by reducing the number of
locked operations required to allocate a frag on x86 and other platforms.
This is accomplished by using atomic_set operations on the page count
instead of calling get_page and put_page.  It is based on work originally
provided by Eric Dumazet.

In addition it also helps to reduce memory overhead when using TCP.  This
is done by recycling the page if the only holder of the frame is the
netdev_alloc_frag call itself.  This can occur when skb heads are stolen by
either GRO or TCP and the driver providing the packets is using paged frags
to store all of the data for the packets.

Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/skbuff.c