netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] Refactor netdev page frags and move them into mm/
@ 2015-05-07  4:11 Alexander Duyck
  2015-05-07  4:11 ` [PATCH 01/10] net: Use cached copy of pfmemalloc to avoid accessing page Alexander Duyck
                   ` (10 more replies)
  0 siblings, 11 replies; 18+ messages in thread
From: Alexander Duyck @ 2015-05-07  4:11 UTC (permalink / raw)
  To: netdev, linux-mm; +Cc: akpm, davem, eric.dumazet

This patch series addresses several things.

First I found an issue in the performance of the pfmemalloc check from
build_skb.  To work around it I have provided a cached copy of pfmemalloc
to be used in __netdev_alloc_skb and __napi_alloc_skb.

Second I moved the page fragment allocation logic into the mm tree and
added functionality for freeing page fragments.  I had to fix igb before I
could do this as it was using a reference to NETDEV_FRAG_PAGE_MAX_SIZE
incorrectly.

Finally I went through and replaced all of the duplicate code that was
calling put_page and replaced it with calls to skb_free_frag.

With these changes in place a simple receive and drop test increased from a
packet rate of 8.9Mpps to 9.8Mpps.  The gains breakdown as follows:

8.9Mpps	Before			9.8Mpps	After
------------------------	------------------------
7.8%	put_compound_page	9.1%	__free_page_frag
3.9%	skb_free_head
1.1%	put_page

4.9%	build_skb		3.8%	__napi_alloc_skb
2.5%	__alloc_rx_skb
1.9%	__napi_alloc_skb

---

Alexander Duyck (10):
      net: Use cached copy of pfmemalloc to avoid accessing page
      igb: Don't use NETDEV_FRAG_PAGE_MAX_SIZE in descriptor calculation
      net: Store virtual address instead of page in netdev_alloc_cache
      mm/net: Rename and move page fragment handling from net/ to mm/
      net: Add skb_free_frag to replace use of put_page in freeing skb->head
      netcp: Replace put_page(virt_to_head_page(ptr)) w/ skb_free_frag
      mvneta: Replace put_page(virt_to_head_page(ptr)) w/ skb_free_frag
      e1000: Replace e1000_free_frag with skb_free_frag
      hisilicon: Replace put_page(virt_to_head_page()) with skb_free_frag()
      bnx2x, tg3: Replace put_page(virt_to_head_page()) with skb_free_frag()


 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c |    2 
 drivers/net/ethernet/broadcom/tg3.c             |    2 
 drivers/net/ethernet/hisilicon/hip04_eth.c      |    2 
 drivers/net/ethernet/intel/e1000/e1000_main.c   |   19 +-
 drivers/net/ethernet/intel/igb/igb_main.c       |   11 -
 drivers/net/ethernet/marvell/mvneta.c           |    2 
 drivers/net/ethernet/ti/netcp_core.c            |    2 
 include/linux/gfp.h                             |    5 +
 include/linux/mm_types.h                        |   18 ++
 include/linux/skbuff.h                          |    9 +
 mm/page_alloc.c                                 |   98 ++++++++++
 net/core/skbuff.c                               |  224 ++++++++---------------
 12 files changed, 223 insertions(+), 171 deletions(-)

--

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2015-05-12 14:39 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-07  4:11 [PATCH 00/10] Refactor netdev page frags and move them into mm/ Alexander Duyck
2015-05-07  4:11 ` [PATCH 01/10] net: Use cached copy of pfmemalloc to avoid accessing page Alexander Duyck
2015-05-10 23:18   ` David Miller
2015-05-11  0:01     ` Alexander Duyck
2015-05-11  0:52       ` David Miller
2015-05-07  4:11 ` [PATCH 02/10] igb: Don't use NETDEV_FRAG_PAGE_MAX_SIZE in descriptor calculation Alexander Duyck
2015-05-07  4:11 ` [PATCH 03/10] net: Store virtual address instead of page in netdev_alloc_cache Alexander Duyck
2015-05-07  4:11 ` [PATCH 04/10] mm/net: Rename and move page fragment handling from net/ to mm/ Alexander Duyck
2015-05-07  4:12 ` [PATCH 05/10] net: Add skb_free_frag to replace use of put_page in freeing skb->head Alexander Duyck
2015-05-07  4:12 ` [PATCH 06/10] netcp: Replace put_page(virt_to_head_page(ptr)) w/ skb_free_frag Alexander Duyck
2015-05-07  4:12 ` [PATCH 07/10] mvneta: " Alexander Duyck
2015-05-07  4:12 ` [PATCH 08/10] e1000: Replace e1000_free_frag with skb_free_frag Alexander Duyck
2015-05-07  8:46   ` Jeff Kirsher
2015-05-07  4:12 ` [PATCH 09/10] hisilicon: Replace put_page(virt_to_head_page()) with skb_free_frag() Alexander Duyck
2015-05-07  4:12 ` [PATCH 10/10] bnx2x, tg3: " Alexander Duyck
2015-05-10 23:17 ` [PATCH 00/10] Refactor netdev page frags and move them into mm/ David Miller
2015-05-11 20:36   ` Andrew Morton
2015-05-12 14:39     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).