fault_in_subpage_writeable(9)
π fault_in_subpage_writeable(9) β Kernel API Manual, but make it make sense
okay so bestie, this is the fault_in_subpage_writeable(9) page from the Kernel API Manual, and it's lowkey about faulting in an address range for writing. Let's get into it β¨
β¨ NAME β¨
fault_in_subpage_writeable β fault in an address range for writing
πΈ SYNOPSIS πΈ
size_t fault_in_subpage_writeable (char __user *uaddr , size_t size );
π ARGUMENTS π
uaddrβ start of address rangesizeβ size of address range
π¦ DESCRIPTION π¦
So this function faults in a user address range for writing, and it checks permissions at sub-page granularity (e.g. arm64 MTE, bestie). Use it when the caller cannot guarantee forward progress of a copy_to_user loop β that's the whole reason it exists.
It returns the number of bytes not faulted in (like copy_to_user and copy_from_user). No cap, that's the return value.
π SEE ALSO π
Kernel file ./mm/gup.c has the whole squad, and here's every single one:
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_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)
okay byeee bestie π«Ά this page comes from the ./mm source, Kernel API Manual section 9, dated October 2026 β 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