From: "Rafael J. Wysocki" <rafael@kernel.org>
To: YoungJun Park <youngjun.park@lge.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
akpm@linux-foundation.org, chrisl@kernel.org,
kasong@tencent.com, pavel@kernel.org, shikemeng@huaweicloud.com,
nphamcs@gmail.com, bhe@redhat.com, baohua@kernel.org,
usama.arif@linux.dev, linux-pm@vger.kernel.org,
linux-mm@kvack.org
Subject: Re: [PATCH v6 3/3] PM: hibernate: fix spurious GFP mask WARNING in uswsusp path
Date: Sat, 21 Mar 2026 12:32:44 +0100 [thread overview]
Message-ID: <CAJZ5v0gVbQQdpyWb72qDcsAoj7vg2v=pXOjdMuWzKHJsdJcHNw@mail.gmail.com> (raw)
In-Reply-To: <ab53krr0y981Qyk8@yjaykim-PowerEdge-T330>
On Sat, Mar 21, 2026 at 11:48 AM YoungJun Park <youngjun.park@lge.com> wrote:
>
> On Fri, Mar 20, 2026 at 07:20:24PM +0100, Rafael J. Wysocki wrote:
> >...
>
> Hi Rafael,
>
> Thanks for the review. Sorry for the back and forth on this one.
> I'm preparing to send the uswsusp GFP mask fix separately as you
> requested (with _nowarn rename and lockdep_assert_held).
>
> Before sending, I wanted to check on the approach. I originally
> found this WARNING while testing uswsusp and thought it was a
> localized issue. But AI review has kept uncovering more cases —
> first SNAPSHOT_FREEZE + snapshot_release(), and now
> dpm_resume_end() when dpm_prepare() fails.
dpm_resume_end() should not be called after a failing dpm_prepare().
Which code path is that?
> More callers than I expected use this defensive restore pattern.
>
> So I'd like your thoughts on the approach:
>
> 1. Introduce pm_restore_gfp_mask_nowarn() and update each caller.
>
> 2. Remove the WARN_ON from pm_restore_gfp_mask() itself, restoring
> the pre-stacking no-op behavior.
>
> I'm leaning towards option 2. Defensive restores are an established
> pattern in multiple paths, and warning against a legitimate no-op
> seems counterproductive — we'd just be playing whack-a-mole with
> _nowarn conversions as more callers turn up.
>
> What do you think?
Using the _nowarn() wariant would help to annotate code paths where
omitting the warning is legitimate.
next prev parent reply other threads:[~2026-03-21 11:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-20 17:03 [PATCH v6 0/3] mm/swap, PM: hibernate: fix swapoff race and optimize swap Youngjun Park
2026-03-20 17:03 ` [PATCH v6 1/3] mm/swap, PM: hibernate: fix swapoff race in uswsusp by pinning swap device Youngjun Park
2026-03-20 17:03 ` [PATCH v6 2/3] mm/swap: remove redundant swap device reference in alloc/free Youngjun Park
2026-03-20 17:03 ` [PATCH v6 3/3] PM: hibernate: fix spurious GFP mask WARNING in uswsusp path Youngjun Park
2026-03-20 18:20 ` Rafael J. Wysocki
2026-03-21 10:48 ` YoungJun Park
2026-03-21 11:32 ` Rafael J. Wysocki [this message]
2026-03-21 11:45 ` Rafael J. Wysocki
2026-03-22 11:31 ` Rafael J. Wysocki
2026-03-21 1:22 ` [PATCH v6 0/3] mm/swap, PM: hibernate: fix swapoff race and optimize swap Andrew Morton
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='CAJZ5v0gVbQQdpyWb72qDcsAoj7vg2v=pXOjdMuWzKHJsdJcHNw@mail.gmail.com' \
--to=rafael@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=bhe@redhat.com \
--cc=chrisl@kernel.org \
--cc=kasong@tencent.com \
--cc=linux-mm@kvack.org \
--cc=linux-pm@vger.kernel.org \
--cc=nphamcs@gmail.com \
--cc=pavel@kernel.org \
--cc=shikemeng@huaweicloud.com \
--cc=usama.arif@linux.dev \
--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