populate_vma_page_range(9)
π populate_vma_page_range(9) β from the Kernel API Manual, bestie π
Okay so real talk, this one lives in the Kernel API Manual (section 9, the kernel-functions girlypop section, iykyk) and it's literally about populating a range of pages in the vma. Let's get into it β¨
πΈ NAME πΈ
populate_vma_page_range β populate a range of pages in the vma. That's it, that's the whole vibe. π
π¦ SYNOPSIS π¦
long populate_vma_page_range (struct vm_area_struct *vma , unsigned long
start , unsigned long end , int *locked );
β ARGUMENTS β
vmaβ the target vma. like, the vma we're doing this to π―startβ start address, no cap πendβ end address, the other end of the situation πlockedβ whether themmap_lockis still held. this one is lowkey the whole plot π
π DESCRIPTION π
So this function takes care of mlocking the pages too, if VM_LOCKED is set. slay, it does the locking for you π«Ά
It returns either the number of pages pinned in the vma, or a negative error code on error. fr fr, that's the deal π
vma->vm_mm->mmap_lock must be held. not optional, bestie. this is a requirement, not a suggestion π
If locked is NULL, it may be held for read or write and will be unperturbed. so basically whatever you were doing, it stays exactly as it was, untouched, unbothered, main character energy β¨
If locked is non-NULL, it must be held for read only, and it may be released. And if it does get released, *locked will be set to 0. so you'll know, okay? π
π SEE ALSO π
Kernel file ./mm/gup.c β and the whole 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)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)
and that's the page, diva π it's from the ./mm corner of the world and it's dated October 2026 β iconique behavior, go populate some page ranges responsibly, mwah π§ββοΈπ
π¦ 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