Re: [PATCH 13/16] mm, swap: defer xswap shrink to workqueue to avoid lock recursion
From: Baoquan He
Date: Thu Sep 03 2026 - 05:25:14 EST
On 09/02/26 at 10:50am, Nhat Pham wrote:
> On Thu, Aug 27, 2026 at 5:57 AM Baoquan He <hebaoquan@xxxxxxxxxx> wrote:
> >
> > xswap_try_shrink() was called directly from __free_cluster() while
> > holding ci->lock. The shrink path calls xswap_unmap_clusters()
> > which unmaps vmalloc pages backing cluster_info, and on return
> > swap_cache_del_folio() tries swap_cluster_unlock(ci) on the now-
> > unmapped address - crashing on a not-present page.
>
> This reads like a bug. It would be a bisectability problem to not
> squash this to an earlier patch, no?
I intentionally keep it as an independent patch. This is a new feature,
we don't need to worry about bisectability problem. Mainly I want to
the code change explained clearer, any people can get it from the git log.
If I squash all them into one commit, it's very hard to let people know
which paragraph describes what change, esp the commit is big.
If it's a logic unit with a reason, I would separate it out as an
independent patch. People review it and ack if no objection, then go to
the next one. It's better than a big patch with which we reviewed one
round, this place is changed, next round, the other place is changed.
Then next round, a new place mixed the 1st place is changed. We sometime
even don't know what is settled, what is not.