minimum_image_size(9)
πΈ NAME πΈ
okay so bestie, this page is from the Kernel API Manual, and the main character is minimum_image_size β literally here to estimate the minimum acceptable size of an image. π
β¨
β¨ SYNOPSIS β¨
unsigned long minimum_image_size (unsigned long saveable );
π ARGUMENTS π
saveableβ the number of saveable pages in the system. thatβs the whole input, bestie π«Ά
π DESCRIPTION π
so the vibe is: we do not want to be out here attempting to free too much memory too hard. π instead, this function estimates the minimum acceptable size of a hibernation image, and that estimate is used as the lower limit for preallocating memory. iconic, honestly.
we assume that the minimum image size should be proportional to
[number of saveable pages] - [number of pages that can be freed in theory]
where that second term is the sum of:
- reclaimable slab pages
- active anonymous pages
- inactive anonymous pages
- active file pages
- inactive file pages
wait, let me say it cleaner: the second term is the sum of (1) reclaimable slab pages, (2) active and (3) inactive anonymous pages, (4) active and (5) inactive file pages. no cap. β¨
π¦ SEE ALSO π¦
kernel file ./kernel/power/snapshot.c β plus these functions, all listed exactly:
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)preallocate_image_pages(9)free_unnecessary_pages(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. this one lives under ./kernel/power, dated October 2026, and yes itβs still minimum_image_size(9) β mwah ππ
π¦ 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