gmap_helper_discard(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… gmap_helper_discard β€” a gmap_helper_discard(9) moment

okay so bestie, welcome to gmap_helper_discard, straight out of section 9 of the Kernel API Manual. no cap, this one is short but it's doing something. let's get into it πŸŽ€


✨ NAME ✨

gmap_helper_discard β€” literally discards user pages in the given range. that's the whole vibe πŸ¦‹


✨ SYNOPSIS ✨

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

like, copy it exactly, spaces and all, don't @ me πŸ’…


✨ ARGUMENTS ✨

  • mm β€” the mm. yes. that's the description. it's giving "main character energy" but the character is an mm_struct 😭
  • vmaddr β€” the starting userspace address. where the party begins πŸŽ‰
  • end β€” the end address, aka the first address outside the range. so it's not invited to the party, it's the bouncer at the door πŸ™ˆ

✨ DESCRIPTION ✨

so, ALL the userspace pages hanging out in the range [vamddr, end) get discarded and unmapped. gone. not invited back. periodt πŸ’€βœ¨

(yes, vamddr β€” that's exactly how it's spelled in the original, and I am simply not the one who's gonna fix it. we respect the text 🫢)

✨ CONTEXT ✨

important bestie, listen: this needs to be called while holding the mmap lock. like, you cannot just roll up without it. that's the whole dress code πŸ”’πŸ‘‘


✨ SEE ALSO ✨

go be nosy in the kernel file ./arch/s390/mm/gmap_helpers.c and also check out the whole friend group:

all of them? iconic. no notes 🌈


and that's the page!! πŸ’– this whole thing comes to you from ./arch/s390/mm, dated October 2026, and it's from the Kernel API Manual era of the man pages. mwah, go hold that mmap lock, love u, bye πŸ“πŸ§šπŸ’œ

πŸ“¦ where this page comes from