net: page_pool: add netlink-based introspection
Status from this message: This series was applied to netdev/net-next.git (main)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest13 patches 9 repliesApplied 13/13
- v313 patches 35 repliesSuperseded
- v215 patches 11 repliesSuperseded 2 of 15 applied
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 15 patches | 20 replies | Superseded |
Changes in v4 from the cover letter
- use dev_net(netdev)->loopback_dev
- extend inflight doc
v3: https://lore.kernel.org/all/[email protected]/
- ID is still here, can't decide if it matters
- rename destroyed -> detach-time, good enough?
- fix build for netsec
v2: https://lore.kernel.org/r/[email protected]
- hopefully fix build with PAGE_POOL=n
v1: https://lore.kernel.org/all/[email protected]/
- The main change compared to the RFC is that the API now exposes outstanding references and byte counts even for "live" page pools. The warning is no longer printed if page pool is accessible via netlink.
RFC: https://lore.kernel.org/all/[email protected]/
Patches in v4 All 13 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/13 | net: page_pool: factor out uninitnet/ | +13 | 1 reply | Applied |
| 2/13 | net: page_pool: id the page poolsinclude/ net/ net/ +2 more | +66 | 2 replies | Applied |
| 3/13 | net: page_pool: record pools per netdevinclude/ include/ include/ +2 more | +114 | 0 replies | Applied |
| 4/13 | net: page_pool: stash the NAPI ID for easier accessinclude/ net/ | +4 | 0 replies | Applied |
| 5/13 | eth: link netdev to page_pools in driversdrivers/ drivers/ drivers/ +1 more | +5 | 0 replies | Applied |
| 6/13 | net: page_pool: add nlspec for basic access to page poolsDocumentation/ | +46 | 0 replies | Applied |
| 7/13 | net: page_pool: implement GET in the netlink APIinclude/ net/ net/ +1 more | +167 | 0 replies | Applied |
| 8/13 | net: page_pool: add netlink notifications for state changesDocumentation/ include/ net/ +2 more | +62 | 0 replies | Applied |
| 9/13 | net: page_pool: report amount of memory held by page poolsDocumentation/ include/ net/ +2 more | +36 | 0 replies | Applied |
| 10/13 | net: page_pool: report when page pool was destroyedDocumentation/ include/ include/ +3 more | +29 | 0 replies | Applied |
| 11/13 | net: page_pool: expose page pool stats via netlinkDocumentation/ Documentation/ include/ +5 more | +250 | 1 reply | Applied |
| 12/13 | net: page_pool: mute the periodic warning for visible page poolsnet/ | +7 | 1 reply | Applied |
| 13/13 | tools: ynl: add sample for getting page-pool informationtools/ tools/ tools/ +4 more | +776 | 0 replies | Applied |
Reviews trailers per patch
All 13 patches have a Reviewed-by or Acked-by.
| Patch | Ilias Apalodimas | Eric Dumazet | Jesper Dangaard Brouer | Mina Almasry | Dragos Tatulea | Shakeel Butt | Daniel Golle |
|---|---|---|---|---|---|---|---|
| Series | T-b | ||||||
| 1/13 | R-b | R-b | A-b | R-b | |||
| 2/13 | R-b | R-b | A-b | R-b | |||
| 3/13 | R-b | A-b | R-b | ||||
| 4/13 | R-b | A-b | |||||
| 5/13 | R-b | A-b | |||||
| 6/13 | R-b | A-b | |||||
| 7/13 | R-b | A-b | |||||
| 8/13 | R-b | A-b | |||||
| 9/13 | A-b | ||||||
| 10/13 | R-b | A-b | T-b | ||||
| 11/13 | A-b | A-b | |||||
| 12/13 | R-b | R-b | A-b | ||||
| 13/13 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 7 reviewers.
Cover letter [PATCH net-next v4 00/13] net: page_pool: add netlink-based introspection
We recently started to deploy newer kernels / drivers at Meta, making significant use of page pools for the first time. We immediately run into page pool leaks both real and false positive warnings. As Eric pointed out/predicted there's no guarantee that applications will read / close their sockets so a page pool page may be stuck in a socket (but not leaked) forever. This happens a lot in our fleet. Most of these are obviously due to application bugs but we should not be printing kernel warnings due to minor application resource leaks.
Conversely the page pool memory may get leaked at runtime, and we have no way to detect / track that, unless someone reconfigures the NIC and destroys the page pools which leaked the pages.
The solution presented here is to expose the memory use of page pools via netlink. This allows for continuous monitoring of memory used by page pools, regardless if they were destroyed or not. Sample in patch 15 can print the memory use and recycling efficiency:
$ ./page-pool
eth0[2] page pools: 10 (zombies: 0)
refs: 41984 bytes: 171966464 (refs: 0 bytes: 0)
recycling: 90.3% (alloc: 656:397681 recycle: 89652:270201)v4:
- use dev_net(netdev)->loopback_dev
- extend inflight doc
v3: https://lore.kernel.org/all/[email protected]/
- ID is still here, can't decide if it matters
- rename destroyed -> detach-time, good enough?
- fix build for netsec
v2: https://lore.kernel.org/r/[email protected]
- hopefully fix build with PAGE_POOL=n
v1: https://lore.kernel.org/all/[email protected]/
- The main change compared to the RFC is that the API now exposes outstanding references and byte counts even for "live" page pools. The warning is no longer printed if page pool is accessible via netlink.
RFC: https://lore.kernel.org/all/[email protected]/
Jakub Kicinski (13):
net: page_pool: factor out uninit
net: page_pool: id the page pools
net: page_pool: record pools per netdev
net: page_pool: stash the NAPI ID for easier access
eth: link netdev to page_pools in drivers
net: page_pool: add nlspec for basic access to page pools
net: page_pool: implement GET in the netlink API
net: page_pool: add netlink notifications for state changes
net: page_pool: report amount of memory held by page pools
net: page_pool: report when page pool was destroyed
net: page_pool: expose page pool stats via netlink
net: page_pool: mute the periodic warning for visible page pools
tools: ynl: add sample for getting page-pool information
Documentation/netlink/specs/netdev.yaml | 172 +++++++ Documentation/networking/page_pool.rst | 10 +- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 1 + .../net/ethernet/mellanox/mlx5/core/en_main.c | 1 + drivers/net/ethernet/microsoft/mana/mana_en.c | 1 + drivers/net/ethernet/socionext/netsec.c | 2 + include/linux/list.h | 20 + include/linux/netdevice.h | 4 + include/linux/poison.h | 2 + include/net/page_pool/helpers.h | 8 +- include/net/page_pool/types.h | 10 + include/uapi/linux/netdev.h | 36 ++ net/core/Makefile | 2 +- net/core/netdev-genl-gen.c | 60 +++ net/core/netdev-genl-gen.h | 11 + net/core/page_pool.c | 69 ++- net/core/page_pool_priv.h | 12 + net/core/page_pool_user.c | 408 +++++++++++++++++ tools/include/uapi/linux/netdev.h | 36 ++ tools/net/ynl/generated/netdev-user.c | 419 ++++++++++++++++++ tools/net/ynl/generated/netdev-user.h | 171 +++++++ tools/net/ynl/lib/ynl.h | 2 +- tools/net/ynl/samples/.gitignore | 1 + tools/net/ynl/samples/Makefile | 2 +- tools/net/ynl/samples/page-pool.c | 147 ++++++ 25 files changed, 1574 insertions(+), 33 deletions(-) create mode 100644 net/core/page_pool_priv.h create mode 100644 net/core/page_pool_user.c create mode 100644 tools/net/ynl/samples/page-pool.c
Signature · 1 line
2.42.0