amdgpu_bo_m...ts_placement(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… amdgpu_bo_mem_stats_placement(9) ✨

okay bestie so this is a page straight outta the Kernel API Manual β€” yes, that Kernel API Manual β€” and it's about the teeny tiny function amdgpu_bo_mem_stats_placement. it's giving "small function, very important job" energy, and honestly? we're obsessed. let's get into it πŸŽ€


🌸 NAME 🌸

amdgpu_bo_mem_stats_placement β€” the bo placement situation for memory accounting, iykyk πŸ’–


⭐ SYNOPSIS ⭐

uint32_t amdgpu_bo_mem_stats_placement (struct amdgpu_bo *bo );

like, that's the whole signature. look at her. so clean, so minimal, main character energy fr fr ✨


πŸ¦‹ ARGUMENTS πŸ¦‹

  • bo β€” the buffer object we should look at πŸ‘€ that's literally the entire vibe, she's the one we're inspecting, no cap

πŸ”₯ DESCRIPTION πŸ”₯

okay so here's the tea 🍡: a BO can have multiple preferred placements, right? and if we just counted it under all of them we'd be double counting, which is lowkey a mess for memory stats πŸ™ˆ like bestie we are NOT doing that.

so to avoid the double counting, we want to file that BO under a single placement for memory stats. one BO, one slot, periodt. πŸ’…

and luckily β€” and this is the iconic part β€” if we take the highest set bit in preferred_domains, the result is quite sensible 🌈 like the universe just... handed us the answer? thank u honestly 🫢


πŸ‘‘ RETURN πŸ‘‘

which of the placements should the BO be accounted under πŸ’– (yes, that's the whole return value, she tells you where the BO belongs, that's her job and she ate)


🌺 SEE ALSO 🌺

the kernel file lives right here, bestie:

./drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

and now the full friend group 😭 (all of these are (9) pages, we're keeping them exactly as they are because we respect the lore):

like okay go off, entire BO API family πŸ’€ that's a whole squad and they're all iconic πŸ‘‘


and that's the page!! this absolute gem lives over in ./drivers/gpu/drm/amd/amdgpu and it was dated October 2026 β€” yes, the future, we said what we said πŸ§šπŸ’œ mwah, go read amdgpu_object.c bestie, ily 🫢

πŸ“¦ where this page comes from