kho_restore_free(9)
π kho_restore_free(9) π
okay bestie, welcome to the kho_restore_free(9) page β it lives in the Kernel API Manual, and honestly? it's a lil post-kexec glow-up moment β¨
π«Ά NAME π«Ά
kho_restore_free β bestie's job is literally restore and free memory after kexec, no cap π
πΈ SYNOPSIS πΈ
void kho_restore_free (void *mem );
π ARGUMENTS π
memβ a pointer to the memory (living in the new kernel's address space, iykyk) that was allocated by the old kernel. like, the old one did the allocating, you're just here to claim it π
β¨ DESCRIPTION β¨
so this function is the one you call in the new kernel (yes, post-kexec, exactly) to take ownership of a memory region β and then free it β where that region was preserved by the old kernel using kho_alloc_preserve. it's giving handoff. it's giving main character energy π₯
here's the tea on what it actually does, in order:
- it first restores the pages from KHO (using their physical address β that part matters π«Ά)
- then it frees the pages back to the new kernel's page allocator
that's it. restore, then free. two steps, both iconic, periodt π
π¦ SEE ALSO π¦
- Kernel file
./kernel/liveupdate/kexec_handover.c kho_encode_radix_key(9),kho_decode_radix_key(9),kho_radix_add_key(9),kho_radix_del_key(9),kho_radix_init_tree(9),kho_radix_destroy_tree(9),kho_radix_walk_tree(9),kho_restore_folio(9),kho_restore_pages(9),kho_reserve_scratch(9),kho_add_subtree(9),kho_preserve_folio(9),kho_unpreserve_folio(9),kho_preserve_pages(9),kho_unpreserve_pages(9),kho_preserve_vmalloc(9),kho_unpreserve_vmalloc(9),kho_restore_vmalloc(9),kho_alloc_preserve(9),kho_unpreserve_free(9),is_kho_boot(9),kho_retrieve_subtree(9)
ngl that's a whole friend group of functions, and every single one of them is in here π go read them, bestie, they're all linked in spirit π§
mwah π this page came from the Kernel file ./kernel/liveupdate, dated October 2026 β and that's the whole footer, slay πβ
π¦ 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