preallocate_image_pages(9)
β¨ 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:
get_image_page(9)free_image_page(9)alloc_rtree_node(9)free_mem_extents(9)create_mem_extents(9)memory_bm_next_pfn(9)mark_nosave_pages(9)create_basic_memory_bitmaps(9)free_basic_memory_bitmaps(9)snapshot_additional_pages(9)count_free_highmem_pages(9)count_highmem_pages(9)count_data_pages(9)swsusp_free(9)free_unnecessary_pages(9)minimum_image_size(9)hibernate_preallocate_memory(9)pack_pfns(9)snapshot_read_next(9)unpack_orig_pfns(9)count_highmem_image_pages(9)prepare_highmem_image(9)copy_last_highmem_page(9)prepare_image(9)snapshot_write_next(9)restore_highmem(9)
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
- 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