mmu_notifier_put(9)
π mmu_notifier_put(9) π
okay so bestie, welcome to the Kernel API Manual β this one's mmu_notifier_put, and it's genuinely one of those "every get needs a put" situations, you know the vibe π«Ά
β¨ NAME β¨
mmu_notifier_put β release the reference on the notifier π
β¨ SYNOPSIS β¨
void mmu_notifier_put(struct mmu_notifier *subscription);
β¨ ARGUMENTS β¨
subscriptionβ the notifier we're acting on, like, the whole point of the call π
β¨ DESCRIPTION β¨
okay so here's the tea β β this function must be paired with each mmu_notifier_get, fr fr. It releases the reference that the get handed you. And if this happens to be the last reference? Then the process to free the notifier gets run asynchronously. not immediately, not right now, asynchronously. she'll get to it π
Now, <rainbow>unlike mmu_notifier_unregister</rainbow>, the get/put flow only calls ops->release when the mm_struct is destroyed. instead, free_notifier is always called to release any resources held by the user. so yeah, free_notifier is the reliable one here π
And because ops->release is not guaranteed to be called, the user has to make sure that all sptes are dropped, and that no new sptes can be established before mmu_notifier_put is called. like, that part is on you, bestie, no cap π
heads up: this function can be called from theops->releasecallback β but even then, the caller must still ensure it's called pairwise withmmu_notifier_get. the pairing rule does not get a day off π€
Also!! modules calling this function must call mmu_notifier_synchronize in their __exit functions to ensure the async work is completed. don't skip it, that's not a vibe π
β¨ SEE ALSO β¨
Kernel file ./mm/mmu_notifier.c π and also:
mmu_interval_read_begin(9)mmu_notifier_register(9)mmu_notifier_get_locked(9)mmu_interval_notifier_insert(9)mmu_interval_notifier_remove(9)mmu_notifier_synchronize(9)
and that's the whole page, periodt πΈ this cutie lives in ./mm, October 2026 edition β go forth and pair your gets and puts, icon π¦π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms