unpin_user_page(9)
π unpin_user_page β the kernel API manual, bestie edition π
okay so real talk, this page lives in the Kernel API Manual (that's the 9 in unpin_user_page(9), iykyk) and it's about letting go of a page you dma-pinned. yes it's a one-function page. yes it still ate. let's go π«Ά
β¨ NAME β¨
unpin_user_page β release a dma-pinned page πΈ
like, you held it, you pinned it, now you're releasing it. closure. main character energy.
β¨ SYNOPSIS β¨
void unpin_user_page (struct page *page );
that's it. that's the whole vibe. void return, one argument, no drama π
β¨ ARGUMENTS β¨
pageβ pointer to the page you're releasing π literally just a pointer to the page to be released. hand it over and let it go.
β¨ DESCRIPTION β¨
okay so this is the important part, bestie, don't skip it π
Pages that were pinned via pin_user_pages*() must be released via either unpin_user_page, or one of the unpin_user_pages*() routines. that's not a suggestion, that's the way it is, fr fr.
and why, you ask? because this is how such pages can be separately tracked and uniquely handled β¨ the pinning system keeps receipts so it knows exactly which pages are special. no cap.
in particular, interactions with RDMA and filesystems need special handling π so yeah, these pages aren't just any pages β they have commitments. use the right unpin routine or the tracking gets messy, and we do not want the tracking to get messy.
β¨ SEE ALSO β¨
the whole friend group π these are all the related pages, Kernel file ./mm/gup.c and:
try_grab_folio(9)unpin_folio(9)folio_add_pin(9)unpin_user_pages_dirty_lock(9)unpin_user_page_range_dirty_lock(9)unpin_user_pages(9)unpin_user_folio(9)unpin_folios(9)try_grab_folio_fast(9)follow_page_mask(9)__get_user_pages(9)fixup_user_fault(9)populate_vma_page_range(9)fault_in_writeable(9)fault_in_subpage_writeable(9)fault_in_readable(9)get_dump_page(9)get_user_pages_remote(9)get_user_pages(9)get_user_pages_fast_only(9)get_user_pages_fast(9)pin_user_pages_fast(9)pin_user_pages_remote(9)pin_user_pages(9)memfd_pin_folios(9)folio_add_pins(9)
like. that's the entire gc. go read them, they're all iconic π¦
and that's the page!! π source/version situation: this one's from ./mm, dated October 2026, and it's unpin_user_page(9) β mwah, periodt π
β¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms