All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged mm-stable] mm-swap-remove-setting-swap_map_bad-for-discard-cluster.patch removed from -mm tree
@ 2025-03-17  5:14 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-03-17  5:14 UTC (permalink / raw)
  To: mm-commits, kasong, shikemeng, akpm


The quilt patch titled
     Subject: mm, swap: remove setting SWAP_MAP_BAD for discard cluster
has been removed from the -mm tree.  Its filename was
     mm-swap-remove-setting-swap_map_bad-for-discard-cluster.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: remove setting SWAP_MAP_BAD for discard cluster
Date: Sun, 23 Feb 2025 00:08:48 +0800

Before alloc from a cluster, we will aqcuire cluster's lock and make sure
it is usable by cluster_is_usable(), so there is no need to set
SWAP_MAP_BAD for cluster to be discarded.

Link: https://lkml.kernel.org/r/20250222160850.505274-5-shikemeng@huaweicloud.com
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Reviewed-by: Kairui Song <kasong@tencent.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/swapfile.c |   11 -----------
 1 file changed, 11 deletions(-)

--- a/mm/swapfile.c~mm-swap-remove-setting-swap_map_bad-for-discard-cluster
+++ a/mm/swapfile.c
@@ -479,15 +479,6 @@ static void move_cluster(struct swap_inf
 static void swap_cluster_schedule_discard(struct swap_info_struct *si,
 		struct swap_cluster_info *ci)
 {
-	unsigned int idx = cluster_index(si, ci);
-	/*
-	 * If scan_swap_map_slots() can't find a free cluster, it will check
-	 * si->swap_map directly. To make sure the discarding cluster isn't
-	 * taken by scan_swap_map_slots(), mark the swap entries bad (occupied).
-	 * It will be cleared after discard
-	 */
-	memset(si->swap_map + idx * SWAPFILE_CLUSTER,
-			SWAP_MAP_BAD, SWAPFILE_CLUSTER);
 	VM_BUG_ON(ci->flags == CLUSTER_FLAG_FREE);
 	move_cluster(si, ci, &si->discard_clusters, CLUSTER_FLAG_DISCARD);
 	schedule_work(&si->discard_work);
@@ -571,8 +562,6 @@ static bool swap_do_scheduled_discard(st
 		 * return the cluster to allocation list.
 		 */
 		ci->flags = CLUSTER_FLAG_NONE;
-		memset(si->swap_map + idx * SWAPFILE_CLUSTER,
-				0, SWAPFILE_CLUSTER);
 		__free_cluster(si, ci);
 		spin_unlock(&ci->lock);
 		ret = true;
_

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:[~2025-03-17  5:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-17  5:14 [merged mm-stable] mm-swap-remove-setting-swap_map_bad-for-discard-cluster.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.