page_range_contiguous(9)
π page_range_contiguous(9) β the kernel API manual, bestie edition π
okay so this is page_range_contiguous(9) from the Kernel API Manual and honestly it's a little vibe-check function for page ranges. let's get into it β¨
πΈ NAME πΈ
page_range_contiguous β literally just vibes-checks whether the page range is contiguous π«Ά
β¨ SYNOPSIS β¨
bool page_range_contiguous (const struct page *page , unsigned long
nr_pages );
no cap, that's the whole signature π
π ARGUMENTS π
pageβ the start of the page range. like, where the range begins, bestie πnr_pagesβ the number of pages in the range. the count, the quantity, the amount π’
π¦ DESCRIPTION π¦
so what it does is: test whether the page range is contiguous, such that they can be iterated naively, corresponding to iterating a contiguous PFN range. that's the whole thing. it's giving "can I just walk this normally without a whole situation" πΆββοΈ
and lowkey important: this function should primarily only be used for debug checks, or when working with page ranges that are not naturally contiguous (e.g., pages within a folio are). iykyk β if your pages are already naturally contiguous, you don't need this, don't be extra π
it returns true if contiguous, otherwise false. that's it. binary. iconic β
π₯ SEE ALSO π₯
Kernel file ./mm/util.c β go look at it, bestie π
kfree_const(9)__kmemdup_nul(9)kstrdup(9)kstrdup_const(9)kstrndup(9)kmemdup(9)kmemdup_array(9)kvmemdup(9)kmemdup_nul(9)memdup_user(9)vmemdup_user(9)strndup_user(9)memdup_user_nul(9)randomize_page(9)__account_locked_vm(9)account_locked_vm(9)__vmalloc_array(9)vmalloc_array(9)__vcalloc(9)vcalloc(9)folio_mapping(9)folio_copy(9)get_cmdline(9)mem_dump_obj(9)compat_set_desc_from_vma(9)__compat_vma_mmap(9)compat_vma_mmap(9)snapshot_page(9)mmap_action_prepare(9)mmap_action_complete(9)folio_pte_batch(9)
and that's the whole page, bestie π this one lives in ./mm and it's dated October 2026 β so like, future vibes only ππ go forth and check your contiguity fr fr π
π¦ 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