pcpu_map_pages(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… pcpu_map_pages β€” okay so this is a <rainbow>kernel API manual</rainbow> page, bestie

Hi hi! Welcome to the pcpu_map_pages(9) page β€” yes, the (9) means it's a kernel API section, iykyk. This is the one that maps pages into a pcpu_chunk, and honestly it's giving lowkey essential. Let's go 🫢


✨ NAME ✨

pcpu_map_pages β€” map pages into a pcpu_chunk πŸ¦‹


✨ SYNOPSIS ✨

int pcpu_map_pages (struct pcpu_chunk *chunk , struct page **pages , int
page_start , int page_end , gfp_t gfp );

That's the whole signature, fr fr β€” copy it exactly, don't be editing it πŸ™ˆ


✨ ARGUMENTS ✨

  • chunk β€” the chunk of interest πŸ’– like, the one we're actually doing stuff to
  • pages β€” the pages array, and it contains all the pages you wanna map
  • page_start β€” page index of the first page to map 🌸
  • page_end β€” page index of the last page to map + 1 ⭐ (yes, plus one β€” it's exclusive at the top end, don't forget the + 1 bestie)
  • gfp β€” allocation flags, passed straight down to the underlying allocator πŸŽ€

✨ DESCRIPTION ✨

So for each cpu, this maps the pages in the range [page_start,page_end) into chunk. Slay. πŸ”₯

Heads up: the caller is responsible for calling pcpu_post_map_flush after all the mappings are complete. Not before, not halfway through β€” after they're all done. That's on you, not on this function πŸ’…

This function is also the one responsible for setting up whatever is necessary for reverse lookup (addr -> chunk). So it's out here doing the behind-the-scenes main character work πŸ‘‘


✨ SEE ALSO ✨

Go read these too, bestie β€” they're all canon 🌈


Anyways, that's the page! 🧚 For the record, the source directory is ./mm and this one's dated October 2026 β€” so yeah, it's timestamped from the future-ish, we love that for us πŸ’€πŸ’œ Byeee, go map some pages responsibly! πŸ“

πŸ“¦ where this page comes from