num_pages_contiguous(9)
π num_pages_contiguous(9) π
okay so welcome to the Kernel API Manual page for num_pages_contiguous, bestie. this one is literally about figuring out how many contiguous pages represent contiguous PFNs. itβs giving βhow far does this run actually goβ energy. β¨
πΈ NAME πΈ
num_pages_contiguous β determine the number of contiguous pages that represent contiguous PFNs. yes, that is the whole assignment. π
β¨ SYNOPSIS β¨
the signature is literally:
size_t num_pages_contiguous (struct page **pages , size_t nr_pages );
π¦ ARGUMENTS π¦
pagesβ an array of page pointers. iconic array ofstruct page *, no cap.nr_pagesβ length of the array, and it has to be at least1. not zero, okay? π
π DESCRIPTION π
okay so num_pages_contiguous determines the number of contiguous pages that represent contiguous PFNs in pages, starting from the first page. main character energy: it starts at the beginning and checks the run. π
β οΈ important caveat, bestie: in some kernel configs, contiguous PFNs will not have contiguousstructpages. in these configurations,num_pages_contiguouswill return anumsmaller than ideal number. so the caller should continue to check for pfn contiguity after each call tonum_pages_contiguous. do not assume one call tells you the whole story. π
it returns the number of contiguous pages. periodt. π
π₯ SEE ALSO π₯
- Kernel file
./include/linux/mm_inline.h folio_is_file_lru(9)__folio_clear_lru_flags(9)folio_lru_list(9)
kisses from the Kernel API Manual corner of the group chat π β source/version: ./include/linux, dated October 2026. num_pages_contiguous(9) out. ππ«Ά
π¦ 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