Re: [RFC PATCH v2 2/7] mm, swap: support zswap and zeroswap as vswap backends
From: Yosry Ahmed
Date: Mon Jun 22 2026 - 20:18:58 EST
[..]
> @@ -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?
> 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
>