public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Leach <matthew.leach@collabora.com>
To: YoungJun Park <youngjun.park@lge.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	 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,
	 kernel@collabora.com
Subject: Re: [PATCH] PM: hibernate: call preallocate_image after freeze prepare
Date: Tue, 24 Mar 2026 09:22:23 +0000	[thread overview]
Message-ID: <87ikalshtc.fsf@collabora.com> (raw)
In-Reply-To: <acFa5+ihROC9/0Va@yjaykim-PowerEdge-T330> (YoungJun Park's message of "Tue, 24 Mar 2026 00:23:19 +0900")

YoungJun Park <youngjun.park@lge.com> writes:

> On Sat, Mar 21, 2026 at 08:51:31AM +0000, Matthew Leach wrote:
>
> Hi Matthew,

Hi Youngjun,

Thanks for the review.

>> +     /* Preallocate image memory before shutting down devices. */
>> +     error = hibernate_preallocate_memory();
>
> The shrink_shmem_memory() below is also intended to run after
> dpm_prepare(), and the motivation is the same. Since
> hibernate_preallocate_memory() already does shrinking internally,
> how about pulling out the shrink-related parts and consolidating
> them together?

Agreed. I'll remove shrink_shmem_memory() completely since
hibernate_preallocate_memory() will have swapped out as many pages as is
required to construct the image in system RAM. There's no point doing
another reclaim.

>> +     if (error)
>> +             goto Thaw;
>
> Don't we need to call dpm_complete(PMSG_RECOVER) in this error path?

Yes, good catch.

Regards,
-- 
Matt

      reply	other threads:[~2026-03-24  9:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-21  8:51 [PATCH] PM: hibernate: call preallocate_image after freeze prepare Matthew Leach
2026-03-23 15:23 ` YoungJun Park
2026-03-24  9:22   ` 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=87ikalshtc.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