pin_user_pages_fast(9)
β¨ pin_user_pages_fast(9) β¨
okay so real talk β this is from the Kernel API Manual, section 9, and it's lowkey one of those functions that's doing a lot behind the scenes. buckle up bestie π
πΈ NAME πΈ
pin_user_pages_fast β pins user pages in memory, and it does it without taking locks. the way that it justβ¦ doesn't need locks? iconic behavior honestly π
π¦ SYNOPSIS π¦
int pin_user_pages_fast (unsigned long start , int nr_pages , unsigned
int gup_flags , struct page **pages );
copy it exactly like that, don't come for me about the spacing, that's just how it's written fr fr π
π ARGUMENTS π
startβ the starting user address. this is where the whole thing kicks off, your little origin point β¨nr_pagesβ how many pages you want pinned, counting fromstart. so like, the page count, the amount, the quantity πgup_flagsβ flags that modify how the pinning behaves. little toggles that change the vibe of the pinning π¦pagesβ the array that receives pointers to the pages that got pinned. it should be at leastnr_pageslong β no skimping, girl, give it the room it needs π
π₯ DESCRIPTION π₯
so it's nearly the same as get_user_pages_fast, except β plot twist β FOLL_PIN is set. that's the whole difference and it's giving main character energy tbh π
if you want the docs on the function arguments, go read get_user_pages_fast, because the arguments here are identical. like, literally identical. no notes π«Ά
FOLL_PIN means the pages must be released via unpin_user_page. that's not a suggestion, bestie, that's the rule π
β οΈ also please go look at Documentation/core-api/pin_user_pages.rst for further details β there's more lore there, iykyk π
and here's the tea you need: π
π¨ if azero_pageis amongst the returned pages, it will not have pins in it, andunpin_user_pagewill not remove pins from it. so like, don't go hunting for pins that were never there, okay? π
π SEE ALSO π
all the siblings and cousins, in the exact order they're listed, no cap:
- Kernel file
./mm/gup.c try_grab_folio(9)unpin_user_page(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_remote(9)pin_user_pages(9)memfd_pin_folios(9)folio_add_pins(9)
likeβ¦ that's a whole friend group right there, slay πβ¨
and that's the whole page, bestie! π
this one comes to you from ./mm, dated October 2026, and yes it's still called pin_user_pages_fast(9) the whole way through π mwah, go pin some pages responsibly π«Άπ
π¦ 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