Re: [RFC PATCH 1/4] block: do not issue background swap bios as root

From: Christoph Hellwig

Date: Mon Sep 28 2026 - 05:46:12 EST


On Mon, Sep 28, 2026 at 10:18:36AM +0200, Alexandre Ghiti wrote:
> bio_issue_as_root_blkg() issues every REQ_SWAP bio as root, bypassing
> the cgroup IO controllers, because reclaim cannot stall indefinitely on
> swap writes. Some swap writes are not urgent though: zswap writeback is
> best effort.
>
> Such a bio cannot simply drop REQ_SWAP: dm-crypt and dm-thin rely on it
> for limit_swap_bios, which caps in-flight swap bios to avoid a memory
> deadlock, see commit a666e5c05e7c ("dm: fix deadlock when swapping to
> encrypted device").

Is that true? REQ_BACKGROUND very much implies the I/O can the throttled
and thus better not be foreground paging, and thus the caller should be
able to tolerate a failure.