From: Andrew Morton <akpm@linux-foundation.org>
To: YoungJun Park <youngjun.park@lge.com>
Cc: rafael@kernel.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 v7 0/2] mm/swap, PM: hibernate: fix swapoff race and optimize swap
Date: Sun, 22 Mar 2026 09:30:38 -0700 [thread overview]
Message-ID: <20260322093038.25a7fd51f5d564b85815db7a@linux-foundation.org> (raw)
In-Reply-To: <ab/E5SaSAlAKLCwD@yjaykim-PowerEdge-T330>
On Sun, 22 Mar 2026 19:31:01 +0900 YoungJun Park <youngjun.park@lge.com> wrote:
> 1. Grab cont_lock on the SWP_HIBERNATION set path, or grab
> swap_lock in add_swap_count_continuation(). This would
> serialize the race, but adds lock contention on a path
> that doesn't really need it.
>
> 2. Convert si->flags to atomic ops. This would be the correct
> fix, but is quite extensive and better suited as a separate
> effort.
>
> However, on mm-new, Kairui's series [1] has removed
> add_swap_count_continuation() and SWP_CONTINUED entirely, so
> this race path no longer exists (verified by code inspection
> and AI review on mm-new).
>
> [1] https://lore.kernel.org/linux-mm/20260128-swap-table-p3-v2-9-fe0b67ef0215@tencent.com/
>
> I based this series on v7.0-rc4 per Rafael's request since it
> depends on PM-side changes. I'm not very familiar with how
> cross-subsystem dependencies are typically coordinated -- if
> rebasing onto mm-new is an option, the race goes away and the
> PM-side changes could be picked up separately. Would that be
> a reasonable approach? I'd appreciate any guidance on this.
The kernel/power/ changes are small. How about we prepare all this
against mm-new and ask Rafael for an ack?
> On a side note -- the AI review is becoming genuinely useful.
> It might be worth having it gate-check patches before they hit
> the mailing list, rather than reviewing after the fact.
Totally agree. Problem is, these review are expensive and permitting
people to check their work before publishing could be terribly abused -
anyone in the world gets free patch review. I don't think Google wants
to pay for that!
Hopefully over time, as engineers see the value in this tool they will
persuade their employers to purchase the tokens they need for such
screening work.
next prev parent reply other threads:[~2026-03-22 16:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-21 10:33 Youngjun Park
2026-03-21 10:33 ` [PATCH v7 1/2] mm/swap, PM: hibernate: fix swapoff race in uswsusp by pinning swap device Youngjun Park
2026-03-21 10:33 ` [PATCH v7 2/2] mm/swap: remove redundant swap device reference in alloc/free Youngjun Park
2026-03-21 17:59 ` [PATCH v7 0/2] mm/swap, PM: hibernate: fix swapoff race and optimize swap Andrew Morton
2026-03-22 10:31 ` YoungJun Park
2026-03-22 16:30 ` Andrew Morton [this message]
2026-03-23 19:56 ` 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=20260322093038.25a7fd51f5d564b85815db7a@linux-foundation.org \
--to=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=rafael@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