STRUCT GPU_BUDDY_BLOCK(9)
π struct gpu_buddy_block(9) β Kernel API Manual
okay bestie, welcome to the struct gpu_buddy_block(9) page, and honestly? this one's a whole vibe. it's the little struct that could, and it lives in the kernel API manual. let's get into it π
β¨ NAME β¨
struct gpu_buddy_block β a Block within a buddy allocator. that's it, that's the tweet π«Ά
πΈ SYNOPSIS πΈ
here's the literal shape of her, no cap, copy-pasted exactly:
struct gpu_buddy_block {
void *private;
union {
struct list_head link;
};
};
look at that anonymous union just vibing in there. iconic. π
π Members π
privateβ Private data owned by the allocator user (e.g., driver-specific data). it's your little pocket of space, the allocator doesn't peek, she's not nosy like that π{unnamed_union}β anonymous. yes queen, no name needed, she simply exists πlinkβ List node for user ownership while block is allocated. so like, when the block is out there living its allocated life, this is how it gets tracked in a list π₯
π¦ Description π¦
okay so here's the lore. Each block in the buddy allocator is represented by this structure β every single one, no exceptions π§
Blocks are organized in a binary tree where each parent block can be split into two children (left and right buddies). it's giving family tree but make it memory management. the way that a parent just splits into two whole buddies? main character energy honestly β¨
The allocator manages blocks at various orders (power-of-2 sizes) from chunk_size up to the largest contiguous region. so like, powers of two all day, starting at chunk_size and going all the way up to the biggest contiguous region there is. slay π
β SEE ALSO β
go read these next, bestie, they're all linked up iykyk:
- Kernel file
./include/linux/gpu_buddy.h GPU_BUDDY_RANGE_ALLOCATION(9)GPU_BUDDY_TOPDOWN_ALLOCATION(9)GPU_BUDDY_CONTIGUOUS_ALLOCATION(9)GPU_BUDDY_CLEAR_ALLOCATION(9)GPU_BUDDY_CLEARED(9)GPU_BUDDY_TRIM_DISABLE(9)struct gpu_buddy(9)gpu_buddy_driver_set_lock(9)gpu_buddy_driver_lock_held(9)
fr fr go read them, they're the supporting cast and they ate π
and that's the page!! this cutie came from ./include/linux and the date on her is October 2026 β so she's from the future, which is very on brand for her tbqh. mwah, go split some blocks, ily π«Άππ
π¦ 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