gmap_helper_discard(9)
π
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 anmm_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:
try_get_locked_pte(9)gmap_helper_zap_one_page(9)gmap_helper_try_set_pte_unused(9)gmap_helper_disable_cow_sharing(9)
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
- 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