page_pool_put_page(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ page_pool_put_page ✨

okay so bestie, welcome to the page_pool_put_page page from the Kernel API Manual 🫢 this is the one where you hand a page back to the pool and let it decide what happens next. no cap, the outcome is genuinely not up to you.


🌸 SYNOPSIS 🌸

void page_pool_put_page (struct page_pool *pool , struct page *page ,
unsigned int dma_sync_size , bool allow_direct );

that's the whole signature, slay. four arguments, zero drama (well, some drama β€” keep reading πŸ’…).


πŸŽ€ ARGUMENTS πŸŽ€

  • pool β€” the pool your page came from in the first place. don't be out here returning pages to random pools, that's not the vibe πŸ™ˆ
  • page β€” the actual page you're dropping a reference on. the main character of this whole operation ✨
  • dma_sync_size β€” how much of the page the device may have touched. literally, how much. you don't get to just say "some of it" 😭
  • allow_direct β€” set this when the release is coming from the consumer and you want to allow lockless caching. key detail, iykyk πŸ”₯

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea β˜• β€” what actually happens here depends entirely on the page refcnt, and there are three separate timelines:

  1. if the driver bumps the refcnt > 1 β€” this will unmap the page. that's it, that's the outcome πŸ’€
  2. if the page refcnt is 1 β€” the allocator owns the page, and it will try to recycle it in one of the pool caches. iconic behavior, honestly πŸ‘‘
  3. if PP_FLAG_DMA_SYNC_DEV is set β€” the page gets synced for_device using dma_sync_single_range_for_device. so your device sees the fresh data, no stale vibes 🌈
bestie please note: the whole function's behavior hinges on that refcnt. check it. know it. respect it. periodt πŸ’…

🧚 SEE ALSO 🧚

like, read the whole friend group honestly πŸ“šπŸ’–


and that's the page!! πŸŽ‰ this absolute baddie of a manpage lives at ./include/net/page_pool and the date on it is October 2026, so yeah, it's from the future and it still ate ⭐ go return some pages responsibly, bestie πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from