Re: [RFC PATCH 2/2] swsusp: make it possible to hibernate to device mapper devices

Askar Safin <[email protected]> Thu, 18 Dec 2025 02:18:37 +0300
Newsgroups dev.linux.lists.lvm-devel,dev.linux.lists.dm-devel,dev.linux.lists.linux-lvm,org.kernel.vger.linux-block,org.kernel.vger.linux-btrfs,org.kernel.vger.linux-crypto,org.kernel.vger.linux-pm,org.kernel.vger.linux-raid,org.kvack.linux-mm
Message-ID <[email protected]>
Mikulas Patocka <[email protected]>:
> Askar Safin requires swap and hibernation on the dm-integrity device mapper
> target because he needs to protect his data.

Hi, Mikulas, Milan and others.

I'm running swap on dm-integrity for 40 days.

It runs mostly without problems.

But yesterday my screen freezed for 4 minutes. And then continued to work
normally.

So, may I ask again a question: is swap on dm-integrity supposed to work
at all? (I. e. swap partition on top of dm-integrity partition on top of
actual disk partition.) (I'm talking about swap here, not about hibernation.)

Mikulas Patocka said here https://lore.kernel.org/all/[email protected]/ :

> Encrypted swap file is not supposed to work. It uses the loop device that 
> routes the requests to a filesystem and the filesystem needs to allocate 
> memory to process requests.

> So, this is what happened to you - the machine runs out of memory, it 
> needs to swap out some pages, dm-crypt encrypts the pages and generates 
> write bios, the write bios are directed to the loop device, the loop 
> device directs them to the filesystem, the filesystem attempts to allocate 
> more memory => deadlock.

Does the same apply to dm-integrity?

I. e. is it possible that write to dm-integrity will lead to allocation?

-- 
Askar Safin