Re: [PATCH] mm: zswap: return -ENOENT when the swap device is gone
From: Andrew Morton
Date: Sun Sep 13 2026 - 03:48:46 EST
On Sun, 13 Sep 2026 14:30:31 +0800 Baoquan He <hebaoquan@xxxxxxxxxx> wrote:
> zswap_writeback_entry() returns -EEXIST when get_swap_device() finds no
> device. -EEXIST is the shrinker's "page already in swap cache" signal,
> which makes zswap_shrinker_scan() stop shrinking entirely. A NULL
> get_swap_device() instead means the device is being swapped off, so the
> entry is simply stale.
>
> Return -ENOENT so the shrinker skips the stale entry and keeps scanning.
> Independent of xswap; affects all swap devices.
I'm struggling to understand the userspace-visible runtime effects of this.
I see that reclaim will prematurely abort, but is this a once-off thing
which will resolve on the next reclaim attempt, or will the reclaim
failure persist for a significant period?