From 41d1d2e162364d7704233af6b4beb342cba56a5f Mon Sep 17 00:00:00 2001 From: SeongJae Park Date: Fri, 22 Aug 2025 12:08:17 -0700 Subject: [PATCH] mm-zswap-store-page_size-compression-failed-page-as-is-v5 - Restore reject_compress_poor code path. - Remove crypto_compress_fail debugfs file. Link: https://lkml.kernel.org/r/20250822190817.49287-1-sj@kernel.org Signed-off-by: SeongJae Park Suggested-by: Nhat Pham Suggested-by: Takero Funaki Acked-by: Nhat Pham Cc: Chengming Zhou Cc: David Hildenbrand Cc: Johannes Weiner Cc: SeongJae Park Cc: Baoquan He Cc: Barry Song Cc: Chris Li Cc: Kairui Song Signed-off-by: Andrew Morton --- mm/zswap.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/mm/zswap.c b/mm/zswap.c index d3ad526ca20b0..0ec239aae9bcf 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -62,8 +62,6 @@ static u64 zswap_written_back_pages; static u64 zswap_reject_reclaim_fail; /* Store failed due to compression algorithm failure */ static u64 zswap_reject_compress_fail; -/* Compression failed by the crypto library */ -static u64 zswap_crypto_compress_fail; /* Compressed page was too big for the allocator to (optimally) store */ static u64 zswap_reject_compress_poor; /* Load or writeback failed due to decompression failure */ @@ -990,14 +988,12 @@ static bool zswap_compress(struct page *page, struct zswap_entry *entry, * only adds metadata overhead. swap_writeout() will put the page back * to the active LRU list in the case. */ - if (comp_ret || !dlen) { - zswap_crypto_compress_fail++; + if (comp_ret || !dlen) dlen = PAGE_SIZE; - } if (dlen >= PAGE_SIZE) { if (!mem_cgroup_zswap_writeback_enabled( folio_memcg(page_folio(page)))) { - comp_ret = -EINVAL; + comp_ret = comp_ret ? comp_ret : -EINVAL; goto unlock; } comp_ret = 0; @@ -1855,8 +1851,6 @@ static int zswap_debugfs_init(void) zswap_debugfs_root, &zswap_reject_kmemcache_fail); debugfs_create_u64("reject_compress_fail", 0444, zswap_debugfs_root, &zswap_reject_compress_fail); - debugfs_create_u64("crypto_compress_fail", 0444, - zswap_debugfs_root, &zswap_crypto_compress_fail); debugfs_create_u64("reject_compress_poor", 0444, zswap_debugfs_root, &zswap_reject_compress_poor); debugfs_create_u64("decompress_fail", 0444, -- 2.51.0