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

From: Christoph Hellwig

Date: Mon Oct 05 2026 - 04:27:10 EST


On Tue, Sep 29, 2026 at 11:16:03AM +0200, Alexandre Ghiti wrote:
> > >
> > > 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?

The issue is that by definition it doesn't need REQ_SWAP then.

Then again the whole concept of REQ_SWAP looks sketchy to me, non-swap
paging can be just as important for forward progress, so if a driver
needs it, it has other issues anyway.