All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged mm-stable] mm-swap-return-early-from-swap_extend_table_try_free-on-first-non-zero-entry.patch removed from -mm tree
@ 2026-10-09  5:58 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-10-09  5:58 UTC (permalink / raw)
  To: mm-commits, youngjun.park, nphamcs, luizcap, kasong, chrisl,
	baoquan.he, baohua, shikemeng, akpm


The quilt patch titled
     Subject: mm, swap: return early from swap_extend_table_try_free() on first non-zero entry
has been removed from the -mm tree.  Its filename was
     mm-swap-return-early-from-swap_extend_table_try_free-on-first-non-zero-entry.patch

This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Kemeng Shi <shikemeng@huaweicloud.com>
Subject: mm, swap: return early from swap_extend_table_try_free() on first non-zero entry
Date: Mon, 7 Sep 2026 17:13:55 +0800

Return immediately when the first non-zero swap count is found as any
non-zero swap count prevents freeing extend_table and further iteration is
pointless.

Link: https://lore.kernel.org/20260907091356.53026-4-shikemeng@huaweicloud.com
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Youngjun Park <youngjun.park@lge.com>
Acked-by: Kairui Song <kasong@tencent.com>
Cc: Baoquan He <baoquan.he@linux.dev>
Cc: Barry Song <baohua@kernel.org>
Cc: Chris Li <chrisl@kernel.org>
Cc: Luiz Capitulino <luizcap@redhat.com>
Cc: Nhat Pham <nphamcs@gmail.com>
---

 mm/swapfile.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

--- a/mm/swapfile.c~mm-swap-return-early-from-swap_extend_table_try_free-on-first-non-zero-entry
+++ a/mm/swapfile.c
@@ -1523,20 +1523,17 @@ int swap_retry_table_alloc(swp_entry_t e
 static void swap_extend_table_try_free(struct swap_cluster_info *ci)
 {
 	unsigned long i;
-	bool can_free = true;
 
 	if (!ci->extend_table)
 		return;
 
 	for (i = 0; i < SWAPFILE_CLUSTER; i++) {
 		if (ci->extend_table[i])
-			can_free = false;
+			return;
 	}
 
-	if (can_free) {
-		kfree(ci->extend_table);
-		ci->extend_table = NULL;
-	}
+	kfree(ci->extend_table);
+	ci->extend_table = NULL;
 }
 
 /* Decrease the swap count of one slot, without freeing it */
_

Patches currently in -mm which might be from shikemeng@huaweicloud.com are



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-09  5:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-09  5:58 [merged mm-stable] mm-swap-return-early-from-swap_extend_table_try_free-on-first-non-zero-entry.patch removed from -mm tree Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.