mmu_interval_set_seq(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… mmu_interval_set_seq(9) β€” a Kernel API Manual moment

Okay bestie, welcome to the page for mmu_interval_set_seq, straight out of the Kernel API Manual. This is the little function that saves your invalidation sequence, and honestly? It's giving "quiet main character" β€” small, does one thing, lowkey essential. πŸŽ€


✨ NAME ✨

mmu_interval_set_seq β€” save the invalidation sequence. That's it, that's the whole vibe. πŸ¦‹


🌸 SYNOPSIS 🌸

void mmu_interval_set_seq (struct mmu_interval_notifier *interval_sub ,
unsigned long cur_seq );

No return value, no drama, just vibes and side effects. πŸ’…


🫢 ARGUMENTS 🫢

  • interval_sub β€” the subscription that got passed to invalidate. Like, the exact one, okay? Don't go finding another one. πŸ™ˆ
  • cur_seq β€” the cur_seq that got passed to the invalidate callback. Same energy: the one you were handed. ⭐

πŸ‘‘ DESCRIPTION πŸ‘‘

So here's the tea, bestie: you must call this unconditionally from the invalidate callback of a struct mmu_interval_notifier_ops, and you must do it under the same lock that's used to call mmu_interval_read_retry. Not "a" lock. The same lock. That part is not optional, fr fr. πŸ”₯

What it actually does? It updates the sequence number for later use by mmu_interval_read_retry. That's the whole job β€” save the sequence now, and mmu_interval_read_retry will pick it up later like the bestie who remembers your coffee order. β˜•πŸ’–

Oh and a fun little detail: the cur_seq you get handed will always be odd. Always. Every single time. No cap. πŸŽ€

Little escape hatch for you: if the caller never calls mmu_interval_read_begin or mmu_interval_read_retry, then this call is not required. So yes β€” you can skip it, but only in that specific situation. Read the room before you skip, okay? 😭

🧚 SEE ALSO 🧚

Kernel file ./include/linux/mmu_notifier.h and its iconic little crew:

Go read them, they're all slaying in their own way. 🌈


And that's the page, bestie! 🫢 This one lives in ./include/linux, from October 2026, and yeah β€” it's the mmu_interval_set_seq(9) page. Go forth and save those sequences. Periodt. πŸ’œβœ¨

πŸ“¦ where this page comes from