svm_range_be...tch_location(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ svm_range_best_prefetch_location β€” it's giving "where should we prefetch tho" ✨

okay bestie, so this one is from the Kernel API Manual, page svm_range_best_prefetch_location(9) β€” yes that's a long name, she's got main character energy, we stan πŸ’…


πŸ’– NAME πŸ’–

svm_range_best_prefetch_location β€” literally decides the best prefetch location. that's it. that's the whole job. πŸŽ€


🌸 SYNOPSIS 🌸

uint32_t svm_range_best_prefetch_location (struct svm_range *prange );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • prange β€” the svm range structure, aka the little data baby we're judging πŸ”

⭐ DESCRIPTION ⭐

alright so this is the whole vibe check, and it depends on whether xnack is off or on. buckle up 🫢

πŸ’œ for xnack off:

if the range maps to a single GPU, then the best prefetch location is prefetch_loc β€” and that can be CPU or GPU. easy, no drama ✨

but if the range is ACCESS or ACCESS_IN_PLACE by mGPUs, then it's only prefetch_loc GPU when the mGPU connection is on XGMI same hive. otherwise? best prefetch location is always CPU. and why, you ask? because a GPU can't have coherent mapping of another GPU's VRAM β€” not even with a large-BAR PCIe connection. like, she simply cannot. nope 😭

πŸ’œ for xnack on:

if the range is not ACCESS_IN_PLACE by mGPUs, then best prefetch location is prefetch_loc, and any other GPU access will generate a vm fault and trigger migration. it's giving "consequences" πŸ’€

if the range is ACCESS_IN_PLACE by mGPUs, then it's only prefetch_loc GPU when the mGPU connection is on XGMI same hive β€” otherwise the best prefetch location is always CPU. periodt πŸ‘‘


🧚 CONTEXT 🧚

Process context 🫑


πŸ”₯ RETURN πŸ”₯

Returns 0 for CPU, or a GPU id 🌈


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/gpu/drm/amd/amdkfd/kfd_svm.c, bestie, plus the whole friend group:


okay that's the page, mwah πŸ’‹ this lives in ./drivers/gpu/drm/amd/amdkfd, dated October 2026, and it's svm_range_best_prefetch_location(9) β€” go be iconic with it πŸ“βœ¨

πŸ“¦ where this page comes from