linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Usama Arif <usama.arif@linux.dev>
To: Youngjun Park <youngjun.park@lge.com>
Cc: Usama Arif <usama.arif@linux.dev>,
	linux-pm@vger.kernel.org, linux-mm@kvack.org, rafael@kernel.org,
	lenb@kernel.org, pavel@kernel.org, akpm@linux-foundation.org,
	chrisl@kernel.org, kasong@tencent.com, shikemeng@huaweicloud.com,
	nphamcs@gmail.com, bhe@redhat.com, baohua@kernel.org
Subject: Re: [RFC PATCH 0/2] kernel/power: fix swap device reference handling in hibernation swap path
Date: Thu,  5 Mar 2026 12:24:12 -0800	[thread overview]
Message-ID: <20260305202413.1888499-1-usama.arif@linux.dev> (raw)
In-Reply-To: <20260302165334.1278479-1-youngjun.park@lge.com>

On Tue,  3 Mar 2026 01:53:32 +0900 Youngjun Park <youngjun.park@lge.com> wrote:

> This series addresses two issues in the hibernation swap path.
> 
> First, grabbing and releasing the swap device reference on every slot
> allocation is inefficient across the entire hibernation swap path.
> 
> Second, in the uswsusp path, only the swap type value is retrieved at
> lookup time without holding a reference. If swapoff races after the
> type is acquired, subsequent slot allocations operate on a stale swap
> device.
> 
> The fix is to hold the swap device reference from the point the swap
> device is looked up, and release it once at each exit path.
> 
>   Patch 1: Release the reference immediately after each slot allocation
>             as a preparatory step.
>   Patch 2: Lift the reference acquisition to the lookup site and place
>             put_swap_device_by_type() at all relevant cleanup paths in
>             swap.c and user.c.

Hello!

I cant comment on the feasibility of the approach, but for proper series,
you would need to squash the 2 commits, otherwise it would break git
bisectability.

Thanks


      parent reply	other threads:[~2026-03-05 20:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-02 16:53 Youngjun Park
2026-03-02 16:53 ` [RFC PATCH 1/2] mm/swap: release swap reference on each hibernation slot allocation Youngjun Park
2026-03-02 16:53 ` [RFC PATCH 2/2] kernel/power: hold swap device reference across hibernation swap operation Youngjun Park
2026-03-05 20:24 ` Usama Arif [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=20260305202413.1888499-1-usama.arif@linux.dev \
    --to=usama.arif@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=baohua@kernel.org \
    --cc=bhe@redhat.com \
    --cc=chrisl@kernel.org \
    --cc=kasong@tencent.com \
    --cc=lenb@kernel.org \
    --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=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