page_range_contiguous(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 πŸ‘€


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