Re: [PATCH v4 00/15] mm, swap: introduce swap table as swap cache (phase I)
From: Kairui Song
Date: Tue Sep 16 2025 - 23:54:17 EST
On Wed, Sep 17, 2025 at 5:23 AM Hugh Dickins <hughd@xxxxxxxxxx> wrote:
>
> 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.
Oh thanks for pointing that out, I fixed that some time ago and forgot
to include it in the change log.
>
> 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/