kho_reserve_scratch(9)
π kho_reserve_scratch(9) π
okay so bestie, welcome to another episode of Kernel API Manual β the section 9 girlies know what's up β¨. Today's main character is kho_reserve_scratch, and honestly? She's lowkey doing a lot of behind-the-scenes work so your kexec handover doesn't fall apart. Let's get into it π
πΈ NAME πΈ
kho_reserve_scratch β reserve a contiguous chunk of memory for kexec π«Ά
β¨ SYNOPSIS β¨
void kho_reserve_scratch (void );
π ARGUMENTS π
voidβ no arguments. not a single one. she takes nothing and she still slays π
π¦ DESCRIPTION π¦
okay so picture this: with KHO we can preserve arbitrary pages in the system β like, the whole vibe is keep whatever pages you want π. But here's the thing, bestie: when we go searching through the physical address space for target memory, we really need to still have a large contiguous region of memory available. So to make sure that happens, let's make sure we always have a large CMA region active. periodt β¨
and like, don't worry about that CMA region being "wasted" β it's only ever used for movable pages, which are literally not a problem for us during KHO, because we can just move them somewhere else. iconic behaviour, no cap π
π₯ SEE ALSO π₯
Kernel file:
./kernel/liveupdate/kexec_handover.c
and the whole friend group π:
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_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)kho_restore_free(9)is_kho_boot(9)kho_retrieve_subtree(9)
and that's the whole page, bestie π this one came to you from <pink>./kernel/liveupdate</pink> and it's dated <purple>October 2026</purple> β go forth and reserve that scratch memory, iykyk π
π
π¦ 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