net: bulk alloc side and more bulk free drivers
Get series with b4
b4 am 20160304130054.32651.51776.stgit@firesoulVersions newest first
- v1 Latest7 patches 12 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | mlx5: use napi_consume_skb API to get bulk free operationsdrivers/ drivers/ drivers/ | +4 | 0 replies | |
| 2/7 | mlx4: use napi_consume_skb API to get bulk free operationsdrivers/ | +13 | 24 replies | |
| 3/7 | net: bulk alloc and reuse of SKBs in NAPI contextnet/ | +45 | 2 replies | |
| 4/7 | mlx5: use napi_alloc_skb API to get SKB bulk allocationsdrivers/ drivers/ drivers/ | +7 | 0 replies | |
| 5/7 | mlx4: use napi_alloc_skb API to get SKB bulk allocationsdrivers/ | +4 | 0 replies | |
| 6/7 | net: introduce napi_alloc_skb_hint() for more use-casesinclude/ net/ | +18 | 0 replies | |
| 7/7 | mlx5: hint the NAPI alloc skb API about the expected bulk sizedrivers/ drivers/ drivers/ | +9 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [net-next PATCH 0/7] net: bulk alloc side and more bulk free drivers
This patchset use the bulk ALLOC side of the kmem_cache bulk APIs, for SKB allocations. The bulk free side got enabled in merge commit 3134b9f019f2 ("net: mitigating kmem_cache free slowpath").
The first two patches is a followup on the free-side, which enables bulk-free in the drivers mlx4 and mlx5 (dev_kfree_skb -> napi_consume_skb).
Rest of patchset is focused on bulk alloc-side. We start with a conservative bulk alloc of 8 SKB, which all drivers using the napi_alloc_skb() call will benefit from. Then the API is extended to, allow driver hinting on needed SKBs (only some drivers know this size), and mlx5 driver is the first user of hinting.
Small hint for people wanting to tune their systems. Default number of SKB objects per slab-page is 32 objects. This limits the bulking sizes for the SLUB allocator. SLUB can be tuned via kernel cmdline boot option slub_min_objects=128. Increasing this gives a significant performance boost, but at the cost of more memory "waste" inside kmem_cache/slab allocator.
Patchset based on net-next at commit 3ebeac1d0295
---
Jesper Dangaard Brouer (7):
mlx5: use napi_consume_skb API to get bulk free operations
mlx4: use napi_consume_skb API to get bulk free operations
net: bulk alloc and reuse of SKBs in NAPI context
mlx5: use napi_alloc_skb API to get SKB bulk allocations
mlx4: use napi_alloc_skb API to get SKB bulk allocations
net: introduce napi_alloc_skb_hint() for more use-cases
mlx5: hint the NAPI alloc skb API about the expected bulk size
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 7 +- drivers/net/ethernet/mellanox/mlx4/en_tx.c | 19 ++++- drivers/net/ethernet/mellanox/mlx5/core/en.h | 5 + drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 11 ++- drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 4 + drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c | 4 + include/linux/skbuff.h | 19 ++++- net/core/skbuff.c | 75 +++++++++++++-------- 8 files changed, 92 insertions(+), 52 deletions(-)