drm_gpusvm_f...h_range_safe(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_gpusvm_for_each_range_safe ✨

okay so bestie, welcome to the Kernel API Manual β€” this one's a macro page, and it's literally the "delete while you loop" bestie you didn't know you needed 🫢


🌸 NAME 🌸

drm_gpusvm_for_each_range_safe β€” safely iterate over GPU SVM ranges in a notifier πŸ’–

Like, the safe version. The one that won't betray you mid-loop 😭


πŸŽ€ SYNOPSIS πŸŽ€

drm_gpusvm_for_each_range_safe (range__ , next__ , notifier__ , start__ , end__ );

five args, all vibes, all required ✨


πŸ¦‹ ARGUMENTS πŸ¦‹

  • range__ β€” your iterator variable for the ranges πŸ‘‘ she's the main character, she holds the current range
  • next__ β€” your iterator variable for the ranges' temporary storage 🧚 this is the secret second slot so you can keep going after you delete something, iykyk
  • notifier__ β€” pointer to the GPU SVM notifier πŸ’« the thing you're looping over, fr fr
  • start__ β€” start address of the range 🌸
  • end__ β€” end address of the range 🌈

⭐ DESCRIPTION ⭐

okay so here's the tea πŸ“ β€” this macro is used to iterate over GPU SVM ranges in a notifier while removing ranges from it.

that's the whole point. that's the slay. you're walking the list and yeeting entries as you go, and it does not fall apart on you πŸ’… periodt.

⚠️ note the safe in the name, bestie β€” that's the one you want when you're mutating the thing you're iterating. don't come crying to me if you use the unsafe one πŸ™ˆ

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./include/drm/drm_gpusvm.h, plus the whole friend group:


and that's the page, bestie πŸŽ€ it lives in ./include/drm, dated October 2026, from the Kernel API Manual β€” go forth and iterate safely πŸ’œβœ¨ no cap 🫢

πŸ“¦ where this page comes from