netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC net-next v2 0/3] page_pool: allow caching from safely localized NAPI
@ 2023-04-05 23:20 Jakub Kicinski
  2023-04-05 23:20 ` [RFC net-next v2 1/3] net: skb: plumb napi state thru skb freeing paths Jakub Kicinski
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Jakub Kicinski @ 2023-04-05 23:20 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, pabeni, hawk, ilias.apalodimas, Jakub Kicinski

I went back to the explicit "are we in NAPI method", mostly
because I don't like having both around :( (even tho I maintain
that in_softirq() && !in_hardirq() is as safe, as softirqs do
not nest).

Still returning the skbs to a CPU, tho, not to the NAPI instance.
I reckon we could create a small refcounted struct per NAPI instance
which would allow sockets and other users so hold a persisent
and safe reference. But that's a bigger change, and I get 90+%
recycling thru the cache with just these patches (for RR and
streaming tests with 100% CPU use it's almost 100%).

Some numbers for streaming test with 100% CPU use (from previous version,
but really they perform the same):

		HW-GRO				page=page
		before		after		before		after
recycle:
cached:			0	138669686		0	150197505
cache_full:		0	   223391		0	    74582
ring:		138551933         9997191	149299454		0
ring_full: 		0             488	     3154	   127590
released_refcnt:	0		0		0		0

alloc:
fast:		136491361	148615710	146969587	150322859
slow:		     1772	     1799	      144	      105
slow_high_order:	0		0		0		0
empty:		     1772	     1799	      144	      105
refill:		  2165245	   156302	  2332880	     2128
waive:			0		0		0		0

Jakub Kicinski (3):
  net: skb: plumb napi state thru skb freeing paths
  page_pool: allow caching from safely localized NAPI
  bnxt: hook NAPIs to page pools

 Documentation/networking/page_pool.rst    |  1 +
 drivers/net/ethernet/broadcom/bnxt/bnxt.c |  1 +
 include/linux/netdevice.h                 |  3 ++
 include/linux/skbuff.h                    | 20 +++++++----
 include/net/page_pool.h                   |  3 +-
 net/core/dev.c                            |  3 ++
 net/core/page_pool.c                      | 15 ++++++--
 net/core/skbuff.c                         | 43 ++++++++++++-----------
 8 files changed, 59 insertions(+), 30 deletions(-)

-- 
2.39.2


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

end of thread, other threads:[~2023-04-10  9:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-05 23:20 [RFC net-next v2 0/3] page_pool: allow caching from safely localized NAPI Jakub Kicinski
2023-04-05 23:20 ` [RFC net-next v2 1/3] net: skb: plumb napi state thru skb freeing paths Jakub Kicinski
2023-04-07  9:15   ` Yunsheng Lin
2023-04-07 14:14     ` Jakub Kicinski
2023-04-07 15:28       ` Jakub Kicinski
2023-04-09 17:28         ` Jesper Dangaard Brouer
2023-04-10  9:20           ` Yunsheng Lin
2023-04-05 23:20 ` [RFC net-next v2 2/3] page_pool: allow caching from safely localized NAPI Jakub Kicinski
2023-04-05 23:21 ` [RFC net-next v2 3/3] bnxt: hook NAPIs to page pools Jakub Kicinski

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).