get_image_page(9)
π get_image_page(9) β like, the hibernation-image page hookup π
okay bestie, buckle up, we're deep in the kernel's power-management brain and this is one of those lil functions from get_image_page(9) (yep, that's the manual page name, we're just vibing with it) β¨
πΈ SYNOPSIS πΈ
void * get_image_page (gfp_t gfp_mask , int safe_needed );
like, that's the whole signature, go off π
π ARGUMENTS π
gfp_maskβ the GFP mask for the allocation, aka the vibe check you pass to the allocator so it knows how you want this page served up πsafe_neededβ if you set this, you get pages that were not used before hibernation (this is a restore-only situation, iykyk) π«Ά
π¦ DESCRIPTION π¦
so during image restoration, when we're storing the PBE list and the image data, we literally can only use memory pages that don't conflict with the pages that were used before hibernation. no cap, that's the whole constraint π₯
the "unsafe" pages are the ones with PageNosaveFree set, and we keep track of how many of those we're dealing with by counting them with allocated_unsafe_pages π
and every allocated image page gets marked as both PageNosave and PageNosaveFree, so that swsusp_free can come through and release it later. it's giving teamwork, it's giving β¨accountabilityβ¨ π§
β SEE ALSO β
the kernel file lives at ./kernel/power/snapshot.c, and here's the whole squad of related functions β literally the entire group chat, no one's left out π:
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)preallocate_image_pages(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)
mwah π that's the page, bestie. it shipped from the ./kernel/power directory and the date on it is October 2026 β so like, she's got a timestamp and she's proud of it. periodt. ππ
π¦ 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