On Wed Sep 10, 2025 at 8:07 PM CEST, Claudio Imbrenda wrote: > Add gmap_helper_set_unused() to mark userspace ptes as unused. > > Core mm code will use that information to discard unused pages instead > of attempting to swap them. > > Signed-off-by: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx> Reviewed-by: Nico Boehr <nrb@xxxxxxxxxxxxx> Tested-by: Nico Boehr <nrb@xxxxxxxxxxxxx> I observed 21965 calls to gmap_helper_set_unused() where we were successfully traversing the page tables to the PTE; of these 21868 made it to the part where _PAGE_UNUSED is set. So _rarely_ we seem to be unable to take the lock (or the PMD changed under us), but in the majority of cases we make it, so this seems fine to me.