gmap_helper_...t_pte_unused(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… gmap_helper_...t_pte_unused(9) β€” from the Kernel API Manual, bestie πŸŽ€

okay so this is a whole manpage from the Kernel API Manual and it's genuinely kinda iconic β€” we're talking about gmap_helper_try_set_pte_unused, a little s390 helper that does exactly one thing and does it well. listen up 🫢


✨ NAME ✨

gmap_helper_try_set_pte_unused β€” the way this function's whole personality is marking a pte entry as unused. that's it. that's the job. no cap πŸ’…


🌸 SYNOPSIS 🌸

void gmap_helper_try_set_pte_unused (struct mm_struct *mm , unsigned
long vmaddr );

like, it returns void (nothing back, she's not a gossip) and takes two args. slay ✨


πŸ¦‹ ARGUMENTS πŸ¦‹

  • mm β€” bestie, this is the mm. the struct mm_struct *. that's the whole description, no notes πŸ™ˆ
  • vmaddr β€” the userspace address whose pte is to be marked. that's the one getting the glow-up (or rather, the un-glow-up) ⭐

πŸ’– DESCRIPTION πŸ’–

so what it does is: it marks the pte corresponding to the given address as unused. and why do we care? because this makes core mm code just drop this page instead of swapping it. literally β€” drop it, don't swap it. bye page πŸ‘‹πŸ’€

and here's the part where you gotta pay attention, bestie, because this is the vibe check that matters πŸ‘‘

This function needs to be called with interrupts disabled (for example while holding a spinlock), or while holding the mmap lock. can't stress this enough 🫢

Normally this function is called as a result of an unmap operation, and thus KVM common code will already hold kvm->mmu_lock in write mode. so lowkey the locking just works out β€” but only because the caller set it up that way. iykyk 😌


πŸ”₯ CONTEXT πŸ”₯

Needs to be called while holding the mmap lock or with interrupts disabled. no exceptions, she's strict about this one πŸ’…

🌈 SEE ALSO 🌈

go read those too, they're all in the same friend group πŸ§šπŸ’œ


and that's the page!! it lives under ./arch/s390/mm, dated October 2026 β€” so like, mark your calendars bestie πŸ“βœ¨ bye!! πŸ’–

πŸ“¦ where this page comes from