On Fri, Aug 11, 2023 at 6:46 PM Yin, Fengwei <fengwei.yin@xxxxxxxxx> wrote: > > > > On 8/12/2023 1:18 AM, Andrew Morton wrote: > > On Fri, 11 Aug 2023 13:20:44 +0800 "Yin, Fengwei" <fengwei.yin@xxxxxxxxx> wrote: > > > >> > >> > >> On 8/11/2023 12:11 PM, Matthew Wilcox wrote: > >>> On Thu, Aug 10, 2023 at 09:35:37AM -0700, Andrew Morton wrote: > >>>> > >>>> The patch titled > >>>> Subject: zswap: don't warn if none swapcache folio is passed to zswap_load > >>>> has been added to the -mm mm-unstable branch. Its filename is > >>>> zswap-make-zswap_load-take-a-folio-fix.patch > >>> > >>> Disagree that this is a fix patch. My original patch does: > >> Agree with Matthew. The warning was not introduced by Matthew's patch. > >> > >>> > >>> - VM_WARN_ON_ONCE(!PageLocked(page)); > >>> - VM_WARN_ON_ONCE(!PageSwapCache(page)); > >>> + VM_WARN_ON_ONCE(!folio_test_locked(folio)); > >>> + VM_WARN_ON_ONCE(!folio_test_swapcache(folio)); > >>> > >>> so I didn't add a new assertion, merely removed a call to > >>> compound_head(). I think this patch deserves to stand on its own and > >>> not be folded into mine. > >>> > > > > OK, so it seems these assertions were added by hannes's "mm: kill > > frontswap" > > (https://lkml.kernel.org/r/20230717160227.GA867137@xxxxxxxxxxx). I'm > > not really sure why - they don't appear to have been moved from > > elsewhere. > > > > So I'll requeue this as a fix against mm-kill-frontswap.patch. > > > > The same two assertions were added to zswap_store(). Are they correct? > My understanding is they are correct as folio needs be added to swap > successfully before hit zswap_store(). Add Yosry for confirmation. Thanks. The PageLocked() (or folio_test_locked()) assertions were moved from __frontswap_store() and __frontswap_load(), so those are not new. The PageSwapCache() checks are new. The one in zswap_load() turned out not to be correct in the case of zram + zswap. As far as I can tell the one in zswap_store() is correct because we always add the page/folio to the swap cache on the swapout path (unlike the swapin path). > > > Regards > Yin, Fengwei > > >