mm: zswap: remove unnecessary trees cleanups in zswap_swapoff()
authorYosry Ahmed <yosryahmed@google.com>
Wed, 24 Jan 2024 04:51:12 +0000 (04:51 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 22 Feb 2024 18:24:39 +0000 (10:24 -0800)
commit83e68f25decdc8d133dbfedd18b93f5267430049
treed724a23f790ad35341791a0a375d442af49bffff
parent64cf264c8fefd013208904e2d1b5ba4ee26ca079
mm: zswap: remove unnecessary trees cleanups in zswap_swapoff()

During swapoff, try_to_unuse() makes sure that zswap_invalidate() is
called for all swap entries before zswap_swapoff() is called.  This means
that all zswap entries should already be removed from the tree.  Simplify
zswap_swapoff() by removing the trees cleanup code, and leave an assertion
in its place.

Link: https://lkml.kernel.org/r/20240124045113.415378-3-yosryahmed@google.com
Signed-off-by: Yosry Ahmed <yosryahmed@google.com>
Reviewed-by: Chengming Zhou <zhouchengming@bytedance.com>
Cc: Chris Li <chrisl@kernel.org>
Cc: "Huang, Ying" <ying.huang@intel.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Nhat Pham <nphamcs@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/zswap.c