Re: [PATCH v4 00/15] mm, swap: introduce swap table as swap cache (phase I)

From: Hugh Dickins
Date: Tue Sep 16 2025 - 17:23:15 EST


On Wed, 17 Sep 2025, Kairui Song wrote:
> V4 changes:
> - Patch 14: fix potential cluster leak when attemp a sleep allocation of
> swap table: Just remove the logic that check and return the percpu
> cluster, it was trying to avoid fragmentation, which wasn't very
> successfully and may not work at all if there are multiple devices.
> The fragmentation is not a serious issue and given the chance of
> hitting that race is extremely low, let's just ignore that [ Chris Meson ].

And in Patch 11 I can see that you've made an important fix to the
!folio_ref_freeze() block in __folio_migrate_mapping(): there had been a
swap_cluster_unlock(ci) which you've fixed to swap_cluster_unlock_irq(ci):
I was going to report that, with the WARNING and "BUG: sleeping function"s
it caused, but you're ahead of me.

Thanks also for fixing the shmem_replace_folio() locking and stats
update, which I'd noticed too (but never hit): looks good now.

Hugh

> - Patch 8 & 9: move some changes from Patch 9 to Patch 8 to avoid build
> error, no code change. [ Baolin Wang ]
> - Patch 9: Fix locking section issue, should protect the shmem statistic
> update with spin lock irq. Also fix an warn on condition.
> Link to V3:
> - https://lore.kernel.org/linux-mm/20250910160833.3464-1-ryncsn@xxxxxxxxx/