public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] zswap pool per-CPU acomp_ctx simplifications
@ 2026-03-17  1:48 Kanchana P. Sridhar
  2026-03-17  1:48 ` [PATCH v2 1/2] mm: zswap: Remove redundant checks in zswap_cpu_comp_dead() Kanchana P. Sridhar
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Kanchana P. Sridhar @ 2026-03-17  1:48 UTC (permalink / raw)
  To: hannes, yosry, nphamcs, chengming.zhou, akpm,
	kanchanapsridhar2026, linux-mm, linux-kernel
  Cc: herbert, senozhatsky

This patchset first removes redundant checks on the acomp_ctx and its
"req" member in zswap_cpu_comp_dead().

Next, it persists the zswap pool's per-CPU acomp_ctx resources to
last until the pool is destroyed. It then simplifies the per-CPU
acomp_ctx mutex locking in zswap_compress()/zswap_decompress().

Code comments added after allocation and before checking to deallocate
the per-CPU acomp_ctx's members, based on expected crypto API return
values and zswap changes this patchset makes.

Patch 2 is an independent submission of patch 23 from [1], to
facilitate merging.

[1]: https://patchwork.kernel.org/project/linux-mm/list/?series=1046677

Changes since v1:
=================
1) Made the changes to eliminate redundant checks on
   acomp_ctx/acomp_ctx->req in zswap_cpu_comp_dead(), per Yosry.
2) Renamed acomp_ctx_dealloc() to acomp_ctx_free(), per Yosry.
3) Incorporated suggestions from Yosry and Sashiko to reset the
   acomp_ctx's members to NULL after freeing them, to prevent UAF and
   double free issues.
4) Replaced v1's patch 2 with v2's patch 1.


Kanchana P. Sridhar (2):
  mm: zswap: Remove redundant checks in zswap_cpu_comp_dead().
  mm: zswap: Tie per-CPU acomp_ctx lifetime to the pool.

 mm/zswap.c | 182 +++++++++++++++++++++++++----------------------------
 1 file changed, 85 insertions(+), 97 deletions(-)

-- 
2.39.5



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2026-03-30 21:53 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-17  1:48 [PATCH v2 0/2] zswap pool per-CPU acomp_ctx simplifications Kanchana P. Sridhar
2026-03-17  1:48 ` [PATCH v2 1/2] mm: zswap: Remove redundant checks in zswap_cpu_comp_dead() Kanchana P. Sridhar
2026-03-17 19:19   ` Yosry Ahmed
2026-03-17 21:09     ` Kanchana P. Sridhar
2026-03-17  1:48 ` [PATCH v2 2/2] mm: zswap: Tie per-CPU acomp_ctx lifetime to the pool Kanchana P. Sridhar
2026-03-27  2:23   ` Andrew Morton
2026-03-27 19:30     ` Kanchana P. Sridhar
2026-03-30 18:32       ` Yosry Ahmed
2026-03-30 18:51         ` Andrew Morton
2026-03-30 18:52           ` Yosry Ahmed
2026-03-30 18:59             ` Kanchana P. Sridhar
2026-03-30 19:12               ` Andrew Morton
2026-03-30 19:13                 ` Yosry Ahmed
2026-03-30 21:53                   ` Kanchana P. Sridhar
2026-03-30 21:47                 ` Kanchana P. Sridhar
2026-03-17 19:45 ` [PATCH v2 0/2] zswap pool per-CPU acomp_ctx simplifications Andrew Morton
2026-03-17 19:48   ` Yosry Ahmed
2026-03-17 21:15     ` Kanchana P. Sridhar
2026-03-17 21:21     ` Kanchana P. Sridhar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox