STRUCT KEXEC_BUF(9)
π struct kexec_buf(9) π
okay so this is a page from the Kernel API Manual β yes, the kernel, and yes, it's exactly as iconic as it sounds. bestie, we're talking about struct kexec_buf, and it's genuinely just a little vibe-check struct for finding a place for a buffer in memory π
β¨ NAME β¨
struct kexec_buf β literally the parameters for finding a place for a buffer in memory. that's the whole job. slay π
πΈ SYNOPSIS πΈ
struct kexec_buf {
struct kimage *image;
void *buffer;
unsigned long bufsz;
unsigned long mem;
unsigned long memsz;
unsigned long buf_align;
unsigned long buf_min;
unsigned long buf_max;
struct page *cma;
bool top_down;
#ifdef CONFIG_CRASH_DUMP;
bool random;
#endif;
};
no cap, that's the whole struct. look at her go π¦
π§ Members π§
okay so let's go field by field, because every single one of these matters and i would never skip one π
imageβ the kexec image in which memory to search. like, which sandbox are we playing in, yk?bufferβ the contents which will be copied to the allocated memory. the actual stuff. the main character πbufszβ size of buffer. self-explanatory, she's not complicated.memβ on return will have address of the buffer in memory. so it goes in empty and comes out with the answer β that's the character arc π₯memszβ size for the buffer in memory.buf_alignβ minimum alignment needed. she has standards β¨buf_minβ the buffer can't be placed below this address. hard floor, periodt.buf_maxβ the buffer can't be placed above this address. hard ceiling, no ceiling jokes pls.cmaβ CMA page if the buffer is backed by CMA.top_downβ allocate from top of memory. top-down girlie energy πrandomβ place the buffer at a random position. chaos. love that for her π
lowkey important: thatrandomfield is wrapped in#ifdef CONFIG_CRASH_DUMP;β so she's only in the struct when that config is on. iykyk π
π«Ά SEE ALSO π«Ά
- Kernel file
./include/linux/kexec.h arch_kexec_locate_mem_hole(9)
and that's the whole page, bestie, ate and left no crumbs ππ
mwah π β this lil number lives in ./include/linux and is dated October 2026, so mark your calendars fr fr β
π¦ 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