Re: [PATCH v2 03/20] KVM: s390: Add gmap_helper_set_unused()

Nico Boehr
2025-09-11T08:38:10Z

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@linux.ibm.com>

Reviewed-by: Nico Boehr <nrb@linux.ibm.com>
Tested-by: Nico Boehr <nrb@linux.ibm.com>

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.