gpu_buddy_alloc_blocks(9)
π¦ NAME π¦
gpu_buddy_alloc_blocks β allocate power-of-two blocks
okay so bestie, this is the page for gpu_buddy_alloc_blocks(9) from the Kernel API Manual, and it's literally about grabbing power-of-two blocks. iconic behavior fr fr π
β¨ SYNOPSIS β¨
int gpu_buddy_alloc_blocks (struct gpu_buddy *mm , u64 start , u64 end ,
u64 size , u64 min_block_size , struct list_head *blocks , unsigned long
flags );
π ARGUMENTS π
mmβ the GPU buddy manager you're allocating from, your main character for this call πstartβ where the allowed range for this block startsendβ where the allowed range for this block endssizeβ how big the allocation is, in bytesmin_block_sizeβ the alignment of the allocationblocksβ output list head where the allocated blocks get addedflagsβ theGPU_BUDDY_*_ALLOCATIONflags
πΈ DESCRIPTION πΈ
alloc_range_bias gets called when there are range limitations β it traverses the tree and returns the desired block. yes, she's doing the whole tree walk, no cap π³β¨
alloc_from_freetree gets called when no range restrictions are enforced β that one picks the block from the freetree. lowkey the simpler vibe π
π RETURN π
0 on success, error code on failure. that's it, that's the tea π«Ά
π SEE ALSO π
Kernel file ./drivers/gpu/buddy.c β and these besties right here:
gpu_buddy_assert(9)gpu_buddy_init(9)gpu_buddy_fini(9)gpu_buddy_reset_clear(9)gpu_buddy_free_block(9)gpu_buddy_allocated_addr_to_block(9)gpu_buddy_free_list(9)gpu_buddy_block_trim(9)gpu_buddy_block_print(9)gpu_buddy_print(9)
and that's the whole page!! source/version: ./drivers/gpu, date: October 2026 β mwah πβ¨
π¦ 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