STRUCT KEXEC_BUF(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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: that random field is wrapped in #ifdef CONFIG_CRASH_DUMP; β€” so she's only in the struct when that config is on. iykyk πŸ’€

🫢 SEE ALSO 🫢


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