[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0hXFtCcon6uBfjXVtst=zDQ6_o-O3aBt4-SH_auw0YBEg@mail.gmail.com>
Date: Wed, 29 Oct 2025 17:07:31 +0100
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Mario Limonciello <superm1@...nel.org>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>, Linux PM <linux-pm@...r.kernel.org>, 
	Askar Safin <safinaskar@...il.com>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1] PM: sleep: Allow pm_restrict_gfp_mask() stacking
On Wed, Oct 29, 2025 at 4:22 PM Mario Limonciello <superm1@...nel.org> wrote:
>
> On 10/28/25 3:52 PM, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> >
> > Allow pm_restrict_gfp_mask() to be called many times in a row to avoid
> > issues with calling dpm_suspend_start() when the GFP mask has been
> > already restricted.
> >
> > Only the first invocation of pm_restrict_gfp_mask() will actually
> > restrict the GFP mask and the subsequent calls will warn if there is
> > a mismatch between the expected allowed GFP mask and the actual one.
> >
> > Moreover, if pm_restrict_gfp_mask() is called many times in a row,
> > pm_restore_gfp_mask() needs to be called matching number of times in
> > a row to actually restore the GFP mask.  Calling it when the GFP mask
> > has not been restricted will cause it to warn.
> >
> > This is necessary for the GFP mask restriction starting in
> > hibernation_snapshot() to continue throughout the entire hibernation
> > flow until it completes or it is aborted (either by a wakeup event or
> > by an error).
> >
> > Fixes: 449c9c02537a1 ("PM: hibernate: Restrict GFP mask in hibernation_snapshot()")
> > Fixes: 469d80a3712c ("PM: hibernate: Fix hybrid-sleep")
> > Reported-by: Askar Safin <safinaskar@...il.com>
> > Closes: https://lore.kernel.org/linux-pm/20251025050812.421905-1-safinaskar@gmail.com/
> > Link: https://lore.kernel.org/linux-pm/20251028111730.2261404-1-safinaskar@gmail.com/
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
>
> Great idea.  Looks good to me, and it passes the S4 tests on my side.
>
> Reviewed-by: Mario Limonciello (AMD) <superm1@...nel.org>
> Tested-by: Mario Limonciello (AMD) <superm1@...nel.org>
Great, thanks!
Powered by blists - more mailing lists
 
