Re: [RFC PATCH 11/11] mm, swap: serialize xswap map/unmap with a mutex
From: Nhat Pham
Date: Mon Jul 27 2026 - 11:23:23 EST
On Mon, Jul 27, 2026 at 7:06 AM Baoquan He <baoquan.he@xxxxxxxxx> wrote:
>
> Concurrent xswap grow operations race on vm_area_map_pages(),
> triggering WARN_ON(!pte_none) in the vmap page table walk when
> one thread sees a PTE already set by another. The -EBUSY safety
> net catches it but the warning is noisy and unavoidable without
> serialization.
>
> Add a per-device mutex (xswap_lock) held across xswap_map_clusters
> and xswap_unmap_clusters so that only one thread can modify the
> VM_SPARSE page table at a time. The shrink path is already
> deferred to a workqueue so it does not contend with itself.
>
> Signed-off-by: Baoquan He <baoquan.he@xxxxxxxxx>
Seems like this should be squashed into one of the older patches, no?