pin_user_pages_remote(9)
π pin_user_pages_remote β like, the kernel manual page, bestie π
okay so real talk, this one lives in the Kernel API Manual section (section 9, kernel devs only, iykyk) and it's literally about pinning down pages of a remote process. no cap. let's get into it π«Ά
β¨ NAME β¨
pin_user_pages_remote β pin pages of a remote process πΈ
π SYNOPSIS π
long pin_user_pages_remote (struct mm_struct *mm , unsigned long start ,
unsigned long nr_pages , unsigned int gup_flags , struct page **pages ,
int *locked );
like, that's the whole vibe. six args, all business π
π¦ ARGUMENTS π¦
mmβ themm_structof the target mm. this is the process whose pages you're about to be obsessed with β¨startβ starting user address. where the whole thing kicks off, fr.nr_pagesβ number of pages fromstartto pin. counting starts now bestie π₯gup_flagsβ flags that modify lookup behaviour. the lil knobs and dials ποΈpagesβ the array that receives pointers to the pages pinned. should be at leastnr_pageslong. at least, so don't come in short, it's giving underprepared πlockedβ pointer to the lock flag, indicating whether the lock is held and subsequently whetherVM_FAULT_RETRYfunctionality can be utilised. the lock must initially be held. main character constraint, periodt π
β DESCRIPTION β
Nearly the same as get_user_pages_remote, except that FOLL_PIN is set. that's the whole plot twist β¨ go read get_user_pages_remote for the documentation on the function arguments, because the arguments here are identical. same energy, different function, iykyk.
FOLL_PIN means the pages must be released via unpin_user_page. no leaving them pinned and ghosting them, that's so toxic π please see Documentation/core-api/pin_user_pages.rst for details β it's all in there, go read it, it ate π
note that if azero_pageis amongst the returned pages, it will not have pins in it, andunpin_user_page*()will not remove pins from it. so like... don't go unpinning what was never pinned, bestie π
π SEE ALSO π
kernel file ./mm/gup.c β and honestly the whole extended friend group:
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_fast(9)pin_user_pages(9)memfd_pin_folios(9)folio_add_pins(9)
and that's the whole page, bestie, no crumbs left π
this absolute icon comes from ./mm in the Kernel API Manual, dated October 2026 β so like, freshly stamped, go forth and pin 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