kho_reserve_scratch(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 πŸ’œ:


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