[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260114142921.1b47d27a3bb22b41ed0c5526@linux-foundation.org>
Date: Wed, 14 Jan 2026 14:29:21 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Kairui Song <ryncsn@...il.com>
Cc: linux-mm@...ck.org, Baoquan He <bhe@...hat.com>, Barry Song
<baohua@...nel.org>, Chris Li <chrisl@...nel.org>, Nhat Pham
<nphamcs@...il.com>, Yosry Ahmed <yosry.ahmed@...ux.dev>, David Hildenbrand
<david@...nel.org>, Johannes Weiner <hannes@...xchg.org>, Youngjun Park
<youngjun.park@....com>, Hugh Dickins <hughd@...gle.com>, Baolin Wang
<baolin.wang@...ux.alibaba.com>, Ying Huang <ying.huang@...ux.alibaba.com>,
Kemeng Shi <shikemeng@...weicloud.com>, Lorenzo Stoakes
<lorenzo.stoakes@...cle.com>, "Matthew Wilcox (Oracle)"
<willy@...radead.org>, linux-kernel@...r.kernel.org,
linux-pm@...r.kernel.org, "Rafael J. Wysocki (Intel)" <rafael@...nel.org>,
Chris Mason <clm@...a.com>, Yi Lai <yi1.lai@...el.com>
Subject: Re: [PATCH v5 14/19] mm, swap: cleanup swap entry management
workflow
On Thu, 15 Jan 2026 00:53:41 +0800 Kairui Song <ryncsn@...il.com> wrote:
> Is it convenient for you to squash this attached fix into this patch?
Done, below
> That's the two issues from Chris Mason and Lai Yi combined in a clean
> to apply format, only 3 lines change.
Let's cc them!
> There might be minor conflict by removing the WARN_ON in two following
> patches, but should be easy to resolve. I can send a v6 if that's
> troublesome.
All fixed up, thanks.
From: Kairui Song <kasong@...cent.com>
Subject: mm, swap: fix locking and leaking with hibernation snapshot releasing
Date: Thu, 15 Jan 2026 00:15:27 +0800
fix leak, per Chris Mason. Remove WARN_ON, per Lai Yi
Link: https://lkml.kernel.org/r/CAMgjq7AUz10uETVm8ozDWcB3XohkOqf0i33KGrAquvEVvfp5cg@mail.gmail.com
Signed-off-by: Kairui Song <kasong@...cent.com>
Cc: Lai Yi <yi1.lai@...ux.intel.com>
Cc: Chris Mason <clm@...com>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
---
kernel/power/swap.c | 2 +-
mm/swapfile.c | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
--- a/kernel/power/swap.c~mm-swap-cleanup-swap-entry-management-workflow-fix
+++ a/kernel/power/swap.c
@@ -199,7 +199,7 @@ void free_all_swap_pages(int swap)
ext = rb_entry(node, struct swsusp_extent, node);
rb_erase(node, &swsusp_extents);
- for (offset = ext->start; offset < ext->end; offset++)
+ for (offset = ext->start; offset <= ext->end; offset++)
swap_free_hibernation_slot(swp_entry(swap, offset));
kfree(ext);
--- a/mm/swapfile.c~mm-swap-cleanup-swap-entry-management-workflow-fix
+++ a/mm/swapfile.c
@@ -2096,7 +2096,6 @@ void swap_free_hibernation_slot(swp_entr
ci = swap_cluster_lock(si, offset);
swap_entry_put_locked(si, ci, entry, 1);
- WARN_ON(swap_entry_swapped(si, entry));
swap_cluster_unlock(ci);
/* In theory readahead might add it to the swap cache by accident */
_
Powered by blists - more mailing lists