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

From: Alexandre Ghiti

Date: Tue Sep 29 2026 - 05:16:41 EST


Hi Christoph,

On Mon, Sep 28, 2026 at 11:44 AM Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
>
> >
> 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.
>

Yes, I agree, zswap writebacks are only best effort and in case of
failure, the compressed entry still lives. I don't see how
REQ_BACKGROUND could be an issue there?