num_pages_contiguous(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 of struct page *, no cap.
  • nr_pages β€” length of the array, and it has to be at least 1. 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 contiguous struct pages. in these configurations, num_pages_contiguous will return a num smaller than ideal number. so the caller should continue to check for pfn contiguity after each call to num_pages_contiguous. do not assume one call tells you the whole story. πŸ’€

it returns the number of contiguous pages. periodt. πŸ’…


πŸ”₯ SEE ALSO πŸ”₯


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