page_pool_fragment_page(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… page_pool_fragment_page β€” kernel API manual, bestie edition πŸ’…

okay so this whole page lives in the kernel API manual (that's the page_pool_fragment_page(9) situation, iykyk) and it's literally about splitting a fresh page into fragments. it's short, it's sweet, it's kind of a baddie. let's get into it πŸŽ€


✨ NAME ✨

page_pool_fragment_page β€” split a fresh page into fragments πŸ¦‹


🌸 SYNOPSIS 🌸

void page_pool_fragment_page (struct page *page , long nr );

πŸŽ€ ARGUMENTS πŸŽ€

  • page β€” the page you're splitting, bestie. that's the one.
  • nr β€” the number of references to set. like, how many you're claiming upfront.

πŸ’– DESCRIPTION πŸ’–

so pp_ref_count is the number of outstanding references to the page, and those references get freed using page_pool APIs β€” not the page allocator APIs like put_page. important distinction, no cap. these references are usually held by page_pool-aware objects, like skbs that are marked for page pool recycling. 🧚

this helper lets the caller take (set) multiple references to a freshly allocated page. and the page must be freshly allocated β€” meaning it has a pp_ref_count of 1. that part is not optional, so don't come at it with a used page, bestie πŸ’€

drivers and "fragment allocators" commonly do this to save atomic operations. it's giving efficiency queen. they do it either when they know upfront how many references they'll need, or when they take MAX references and return the unused ones with a single atomic dec instead of doing multiple atomic inc operations. one and done. slay. ⭐


πŸ‘‘ SEE ALSO πŸ‘‘


🫢 and that's the whole vibe! this one came from ./include/net/page_pool and it's dated October 2026 β€” so like, from the future, main character energy fr fr. go forth and fragment responsibly πŸ’œβœ¨

πŸ“¦ where this page comes from