Re: [RFC PATCH v2 2/7] mm, swap: support zswap and zeroswap as vswap backends
From: Nhat Pham
Date: Wed Jun 24 2026 - 18:41:55 EST
On Mon, Jun 22, 2026 at 5:18 PM Yosry Ahmed <yosry@xxxxxxxxxx> wrote:
>
> [..]
> > @@ -1623,16 +1642,14 @@ int zswap_load(struct folio *folio)
> > if (entry->objcg)
> > count_objcg_events(entry->objcg, ZSWPIN, 1);
> >
> > - /*
> > - * We are reading into the swapcache, invalidate zswap entry.
> > - * The swapcache is the authoritative owner of the page and
> > - * its mappings, and the pressure that results from having two
> > - * in-memory copies outweighs any benefits of caching the
> > - * compression work.
> > - */
>
> Forgot to ask, is dropping this comment intentional?
Ooops. Lemme restore it.
>
> > folio_mark_dirty(folio);
> > - xa_erase(tree, offset);
> > - zswap_entry_free(entry);
> > +
> > + if (swap_is_vswap(si)) {
> > + folio_release_vswap_backing(folio);
> > + } else {
> > + xa_erase(swap_zswap_tree(swp), swp_offset(swp));
> > + zswap_entry_free(entry);
> > + }
> >
> > folio_unlock(folio);
> > return 0;
> > --
> > 2.53.0-Meta
> >