]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm-zswap-store-page_size-compression-failed-page-as-is-v5
authorSeongJae Park <sj@kernel.org>
Fri, 22 Aug 2025 19:08:17 +0000 (12:08 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 12 Sep 2025 00:24:56 +0000 (17:24 -0700)
- 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 <sj@kernel.org>
Suggested-by: Nhat Pham <nphamcs@gmail.com>
Suggested-by: Takero Funaki <flintglass@gmail.com>
Acked-by: Nhat Pham <nphamcs@gmail.com>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: David Hildenbrand <david@redhat.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: SeongJae Park <sj@kernel.org>
Cc: Baoquan He <bhe@redhat.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Chris Li <chrisl@kernel.org>
Cc: Kairui Song <kasong@tencent.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/zswap.c

index d3ad526ca20b0625ffd3acb2ea76fcac76039add..0ec239aae9bcf54a752def2faeb17b8e01e62382 100644 (file)
@@ -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,