Re: [PATCH 07/16] mm, swap: add xswap grow trigger on cluster allocation
From: Baoquan He
Date: Thu Sep 03 2026 - 04:52:57 EST
On 09/02/26 at 10:15am, Nhat Pham wrote:
> On Thu, Aug 27, 2026 at 5:45 AM Baoquan He <hebaoquan@xxxxxxxxxx> wrote:
> >
> > When cluster_alloc_swap_entry() fails to find a free cluster and
> > the xswap device still has room to grow, expand the mapped range
> > by XSWAP_GROW_CLUSTERS clusters.
> >
> > Since xswap is always SWP_SOLIDSTATE, no locks need to be dropped
> > before calling xswap_map_clusters(), global_cluster_lock is never
> > held on this path.
>
> What about local_lock()? I believe we're still holding
> percpu_swap_cluster's local lock as we invoke xswap_map_clusters()?
> Would this lead to issues :/
Good question. Kashiko also reported this , have fixed it by moving
swap_alloc_slow()() out of the lock scope as swap_alloc_slow() does not
touch the per-cpu swap cluster cache.