restore_highmem(9)
β¨ restore_highmem(9) β¨
okay bestie, so this one's from the Kernel API Manual and it's literally called restore_highmem β yes, that's restore_highmem(9), section 9, we're in kernel-land now π
πΈ NAME πΈ
restore_highmem β put highmem image pages into their original locations π
π¦ SYNOPSIS π¦
int restore_highmem (void );
π ARGUMENTS π
voidβ no arguments, bestie. none. zero. the void is voiding π«Ά
π₯ DESCRIPTION π₯
okay so here's the vibe: for each highmem page that was in use before hibernation and is included in the image, and also has been allocated by the "restore" kernel β this function swaps its current contents with the previous ones (that's the "before hibernation" ones, iykyk) π
and like, if the restore eventually fails? no biggie, not the end of the world β you can just call this function once again and restore the highmem state as seen by the restore kernel. iconic recovery behaviour, honestly π
π SEE ALSO π
it's giving β¨ extended universe β¨ β this thing lives in the kernel file ./kernel/power/snapshot.c, and it's friends with literally everyone:
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)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)
π real talk though: read the DESCRIPTION again before you go swapping page contents around, because this is literally memory state from before hibernation. slay responsibly π«Ά
and that's the whole page, bestie β brought to you by the good people at ./kernel/power, dated October 2026 β¨π go forth and restore those highmem pages ππ¦
π¦ 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