From: Matthew Leach <matthew.leach@collabora.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Pavel Machek <pavel@kernel.org>, Len Brown <lenb@kernel.org>,
Mario Limonciello <mario.limonciello@amd.com>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
YoungJun Park <youngjun.park@lge.com>,
kernel@collabora.com
Subject: Re: [PATCH v2] PM: hibernate: call preallocate_image after freeze prepare
Date: Wed, 01 Apr 2026 11:13:32 +0100 [thread overview]
Message-ID: <87a4vnhttf.fsf@collabora.com> (raw)
In-Reply-To: <CAJZ5v0hjaMFezGQx+pF-TuLBQ-8wNYzd8ZBu+6XCV0=YgEx0Ew@mail.gmail.com> (Rafael J. Wysocki's message of "Tue, 31 Mar 2026 14:45:35 +0200")
Hi Rafael,
Thanks for the review.
"Rafael J. Wysocki" <rafael@kernel.org> writes:
> On Thu, Mar 26, 2026 at 12:37 PM Matthew Leach
> <matthew.leach@collabora.com> wrote:
[...]
>> @@ -493,9 +465,9 @@ int hibernation_snapshot(int platform_mode)
>> return error;
>>
>> Thaw:
>
> swsusp_free() needs to be called here AFAICS or you'll see memory
> allocation failures subsequently in some cases.
We only jump to this label in two places:
- If dpm_prepare(PMSG_FREEZE) returns an error.
hibernate_preallocate_memory() hasn't been called yet so there's no
memory to free.
- If hibernate_preallocate_memory() returns an error; in that instance
hibernate_preallocate_memory() calls swsusp_free() to cleanup any
memory that may have been allocated before returning the error.
AFAICS, I don't think we need an extra call to swsusp_free(). Happy to
change if I'm missing something though.
Regards,
--
Matt
prev parent reply other threads:[~2026-04-01 10:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-26 11:36 [PATCH v2] PM: hibernate: call preallocate_image after freeze prepare Matthew Leach
2026-03-26 13:09 ` Mario Limonciello
2026-03-31 12:45 ` Rafael J. Wysocki
2026-04-01 10:13 ` Matthew Leach [this message]
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=87a4vnhttf.fsf@collabora.com \
--to=matthew.leach@collabora.com \
--cc=kernel@collabora.com \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=pavel@kernel.org \
--cc=rafael@kernel.org \
--cc=youngjun.park@lge.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