gpu_buddy_alloc_blocks(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ 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 starts
  • end β€” where the allowed range for this block ends
  • size β€” how big the allocation is, in bytes
  • min_block_size β€” the alignment of the allocation
  • blocks β€” output list head where the allocated blocks get added
  • flags β€” the GPU_BUDDY_*_ALLOCATION flags

🌸 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:


and that's the whole page!! source/version: ./drivers/gpu, date: October 2026 β€” mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from