zswap: export compression failure stats
authorNhat Pham <nphamcs@gmail.com>
Tue, 24 Oct 2023 23:45:09 +0000 (16:45 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 1 Nov 2023 19:38:35 +0000 (12:38 -0700)
commitcb61dad80fdc6a8f01b101e823a9335cd6d61071
tree0621306f5236feb67597fc660d1a9c1bd62192d9
parent9fb2047d23d5087e124e7bc7a0abdc3f0d7f5d7e
zswap: export compression failure stats

During a zswap store attempt, the compression algorithm could fail (for
e.g due to the page containing incompressible random data).  This is not
tracked in any of existing zswap counters, making it hard to monitor for
and investigate.  We have run into this problem several times in our
internal investigations on zswap store failures.

This patch adds a dedicated debugfs counter for compression algorithm
failures.

Link: https://lkml.kernel.org/r/20231024234509.2680539-1-nphamcs@gmail.com
Signed-off-by: Nhat Pham <nphamcs@gmail.com>
Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Dan Streetman <ddstreet@ieee.org>
Cc: Domenico Cerasuolo <cerasuolodomenico@gmail.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Seth Jennings <sjenning@redhat.com>
Cc: Shakeel Butt <shakeelb@google.com>
Cc: Vitaly Wool <vitaly.wool@konsulko.com>
Cc: Yosry Ahmed <yosryahmed@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/zswap.c