From: Milan Broz <gmazyland@gmail.com>
To: Askar Safin <safinaskar@gmail.com>, mpatocka@redhat.com
Cc: Dell.Client.Kernel@dell.com, dm-devel@lists.linux.dev,
linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org,
linux-crypto@vger.kernel.org, linux-lvm@lists.linux.dev,
linux-mm@kvack.org, linux-pm@vger.kernel.org,
linux-raid@vger.kernel.org, lvm-devel@lists.linux.dev,
pavel@ucw.cz, rafael@kernel.org
Subject: Re: [RFC PATCH 2/2] swsusp: make it possible to hibernate to device mapper devices
Date: Mon, 22 Dec 2025 16:03:22 +0100 [thread overview]
Message-ID: <86300955-72e4-42d5-892d-f49bdf14441e@gmail.com> (raw)
In-Reply-To: <20251217231837.157443-1-safinaskar@gmail.com>
On 12/18/25 12:18 AM, Askar Safin wrote:
> Mikulas Patocka <mpatocka@redhat.com>:
>> 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.)
Hi,
I am not sure if Mikulas is available; maybe it's better to try again
in January...
Anyway, my understanding is that all device-mapper targets use mempools,
which should ensure that they can process even under memory pressure.
AFAIK, swap over a device-mapper target (any target!) with a real block device
should be ok. The problematic part is stacking over a filesystem (through a loop)
as Mikulas mentioned.
If I interpret Mikulas' answer correctly, it is the filesystem that could
allocate memory here, and it deadlocks because of it (as it is swap itself).
So I believe it can happen with other DM targets too.
(If I am mistaken, please correct me.)
I wish it could work, but I do not understand kernel details anymore here.
It seems we are still in "a little walled gardens" communication issues
among various kernel subsystems, as one of the former maintainers said :-)
But you asked about a real block device, so it should work.
I guess it is just another bug you see...
Milan
>
> Mikulas Patocka said here https://lore.kernel.org/all/3f3d871a-6a86-354f-f83d-a871793a4a47@redhat.com/ :
>
>> 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?
>
next prev parent reply other threads:[~2025-12-22 15:03 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-23 11:29 dm bug: hibernate to swap located on dm-integrity doesn't work (how to get data redundancy for swap?) Askar Safin
2025-10-23 20:42 ` Milan Broz
2025-10-24 16:31 ` Askar Safin
2025-10-24 17:50 ` Milan Broz
2025-10-25 5:26 ` Askar Safin
2025-10-27 8:08 ` Askar Safin
[not found] ` <4cd2d217-f97d-4923-b852-4f8746456704@mazyland.cz>
2025-10-24 10:23 ` [PATCH] pm-hibernate: flush block device cache when hibernating Mikulas Patocka
2025-10-27 8:42 ` Askar Safin
2025-10-31 19:29 ` Mikulas Patocka
2025-10-31 19:33 ` [PATCH 1/2] pm-hibernate: flush disk cache when suspending Mikulas Patocka
2025-11-03 15:53 ` Askar Safin
2025-11-22 13:51 ` Milan Broz
2025-11-22 20:33 ` Askar Safin
2025-11-22 22:47 ` Askar Safin
2025-11-24 19:51 ` Mikulas Patocka
2025-10-31 19:35 ` [RFC PATCH 2/2] swsusp: make it possible to hibernate to device mapper devices Mikulas Patocka
2025-11-30 0:56 ` Askar Safin
2025-12-17 23:18 ` Askar Safin
2025-12-22 15:03 ` Milan Broz [this message]
2025-12-22 22:24 ` Askar Safin
2025-12-23 1:41 ` Askar Safin
2025-12-23 5:29 ` Askar Safin
2025-12-23 6:33 ` Askar Safin
2025-10-29 13:31 ` [PATCH] pm-hibernate: flush block device cache when hibernating Rafael J. Wysocki
2025-10-29 14:38 ` Christoph Hellwig
2025-10-29 16:31 ` Mikulas Patocka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86300955-72e4-42d5-892d-f49bdf14441e@gmail.com \
--to=gmazyland@gmail.com \
--cc=Dell.Client.Kernel@dell.com \
--cc=dm-devel@lists.linux.dev \
--cc=linux-block@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-lvm@lists.linux.dev \
--cc=linux-mm@kvack.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=lvm-devel@lists.linux.dev \
--cc=mpatocka@redhat.com \
--cc=pavel@ucw.cz \
--cc=rafael@kernel.org \
--cc=safinaskar@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox