@@ -62,6 +62,8 @@ static u64 zswap_pool_limit_hit;
62
62
static u64 zswap_written_back_pages ;
63
63
/* Store failed due to a reclaim failure after pool limit was reached */
64
64
static u64 zswap_reject_reclaim_fail ;
65
+ /* Store failed due to compression algorithm failure */
66
+ static u64 zswap_reject_compress_fail ;
65
67
/* Compressed page was too big for the allocator to (optimally) store */
66
68
static u64 zswap_reject_compress_poor ;
67
69
/* Store failed because underlying allocator could not get memory */
@@ -1312,8 +1314,10 @@ bool zswap_store(struct folio *folio)
1312
1314
ret = crypto_wait_req (crypto_acomp_compress (acomp_ctx -> req ), & acomp_ctx -> wait );
1313
1315
dlen = acomp_ctx -> req -> dlen ;
1314
1316
1315
- if (ret )
1317
+ if (ret ) {
1318
+ zswap_reject_compress_fail ++ ;
1316
1319
goto put_dstmem ;
1320
+ }
1317
1321
1318
1322
/* store */
1319
1323
zpool = zswap_find_zpool (entry );
@@ -1553,6 +1557,8 @@ static int zswap_debugfs_init(void)
1553
1557
zswap_debugfs_root , & zswap_reject_alloc_fail );
1554
1558
debugfs_create_u64 ("reject_kmemcache_fail" , 0444 ,
1555
1559
zswap_debugfs_root , & zswap_reject_kmemcache_fail );
1560
+ debugfs_create_u64 ("reject_compress_fail" , 0444 ,
1561
+ zswap_debugfs_root , & zswap_reject_compress_fail );
1556
1562
debugfs_create_u64 ("reject_compress_poor" , 0444 ,
1557
1563
zswap_debugfs_root , & zswap_reject_compress_poor );
1558
1564
debugfs_create_u64 ("written_back_pages" , 0444 ,
0 commit comments