preallocate_image_pages(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ preallocate_image_pages(9) ✨

okay so bestie, welcome to the Kernel API Manual entry for preallocate_image_pages β€” yes it's a section 9 page, yes it's about hibernation, and yes we're gonna get through it together πŸ’…


πŸŽ€ NAME πŸŽ€

preallocate_image_pages β€” allocate a number of pages for the hibernation image πŸ’–

Like, it goes and grabs page frames ahead of time so the hibernation image has somewhere to live. Very "reserving the good seats before the group chat shows up" energy 🫢


🌸 SYNOPSIS 🌸

unsigned long preallocate_image_pages (unsigned long nr_pages , gfp_t
mask );

That's the whole signature, no cap β€” it hands you back an unsigned long, takes an unsigned long and a gfp_t, and that's it πŸ”₯


πŸ¦‹ ARGUMENTS πŸ¦‹

  • nr_pages β€” the number of page frames to allocate. how many we're grabbin', basically πŸ“
  • mask β€” the GFP flags to use for the allocation. the vibe/mode the allocator runs in ✨

πŸ’œ DESCRIPTION πŸ’œ

Return value: the number of page frames actually allocated πŸ‘‘

real talk: that's literally the whole description in the original. it allocates, and it tells you how many it really got β€” which, lowkey, is the useful part, because "asked for" and "got" are not always the same number πŸ™ˆ

🌈 SEE ALSO 🌈

so there's a whole little friend group here, and they all live in the kernel file ./kernel/power/snapshot.c πŸ“ β€” go say hi to all of them:


and that's the whole page, bestie, you ate that 🧚

this little cutie lives in ./kernel/power and the manual is dated October 2026 β€” so yeah, future-dated and still serving πŸ’…βœ¨ bye bestie, go hibernate something πŸ¦‹

πŸ“¦ where this page comes from