svm_range_c...e_pagetables(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… svm_range_cpu_invalidate_pagetables(9) β€” NAME

okay so bestie, welcome to the svm_range_cpu_invalidate_pagetables page, straight out of the Kernel API Manual (section 9, kernel-space, very demure, very mindful). the header up top literally reads svm_range_c...e_pagetables(9) because even man pages get a little truncated sometimes, slay.

svm_range_cpu_invalidate_pagetables β€” interval notifier callback πŸŽ€

like, that's it, that's the whole NAME section. she's an interval notifier callback. main character energy fr fr.


✨ SYNOPSIS ✨

bool svm_range_cpu_invalidate_pagetables (struct mmu_interval_notifier
* mni , const struct mmu_notifier_range *range , unsigned long cur_seq );

she returns a bool, she takes three args, and no, you cannot skip any of them. all three or nothing, periodt. 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • mni β€” the mmu_interval_notifier struct. that's your notifier bestie herself πŸ’–
  • range β€” the mmu_notifier_range struct. the range in question, iconic ✨
  • cur_seq β€” the value to pass to mmu_interval_set_seq. she's a sequence number and she's booked and busy πŸ”₯

🌸 DESCRIPTION 🌸

so here's the tea. if the event is MMU_NOTIFY_UNMAP, that means this is coming from a CPU unmap range. otherwise? it's coming from migration, or from the CPU page invalidation callback. iykyk. πŸ’…

for the unmap event: you unmap the range from the GPUs, you remove the prange from svms in a delayed work thread, and you split the prange if only part of the prange is unmapped. not me doing three things at once 😭

for the invalidation event: it depends on whether GPU retry fault is enabled, and this is the part you cannot sleep on:

  • if GPU retry fault is not enabled β€” evict the queues, then schedule svm_range_restore_work to update the GPU mapping and resume the queues. like a whole lil pipeline, we love to see it 🌈
  • if GPU retry fault is enabled β€” unmap the svm range from the GPU, and retry fault will update the GPU mapping to recover. she heals herself, honestly obsessed 🧚

πŸ‘‘ CONTEXT πŸ‘‘

big mood, pay attention: the mmap lock and the notifier_invalidate_start lock are held for the invalidate event, and the prange lock is held if this is from migration.

bestie please internalize which locks are held when. this is not a drill, this is a lock context note. πŸ’€

⭐ SEE ALSO ⭐

the whole friend group, no cap β€” all of these live in the Kernel file ./drivers/gpu/drm/amd/amdkfd/kfd_svm.c:

go read them, they're all icons too, i don't make the rules πŸŽ€βœ¨


🫢 SIGN-OFF 🫢

and that's the page!! sourced from ./drivers/gpu/drm/amd/amdkfd, dated October 2026 β€” mwah, drink water, and don't forget which locks you're holding. bye bestie!! πŸ’–πŸŒΈπŸ¦‹πŸ‘‘

πŸ“¦ where this page comes from