All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged mm-stable] mm-swap-drop-last-swap_map_shmem-flag-in-batch-in-swap_entries_put_nr.patch removed from -mm tree
@ 2025-05-12  0:50 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-05-12  0:50 UTC (permalink / raw)
  To: mm-commits, tim.c.chen, kasong, bhe, shikemeng, akpm


The quilt patch titled
     Subject: mm: swap: drop last SWAP_MAP_SHMEM flag in batch in swap_entries_put_nr()
has been removed from the -mm tree.  Its filename was
     mm-swap-drop-last-swap_map_shmem-flag-in-batch-in-swap_entries_put_nr.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: drop last SWAP_MAP_SHMEM flag in batch in swap_entries_put_nr()
Date: Wed, 26 Mar 2025 00:25:25 +0800

The SWAP_MAP_SHMEM indicates last map from shmem.  Therefore we can drop
SWAP_MAP_SHMEM in batch in similar way to drop last ref count in batch.

Link: https://lkml.kernel.org/r/20250325162528.68385-6-shikemeng@huaweicloud.com
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Reviewed-by: Tim Chen <tim.c.chen@linux.intel.com>
Reviewed-by: Baoquan He <bhe@redhat.com>
Cc: Kairui Song <kasong@tencent.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/swapfile.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--- a/mm/swapfile.c~mm-swap-drop-last-swap_map_shmem-flag-in-batch-in-swap_entries_put_nr
+++ a/mm/swapfile.c
@@ -192,7 +192,7 @@ static bool swap_is_last_map(struct swap
 	unsigned char *map_end = map + nr_pages;
 	unsigned char count = *map;
 
-	if (swap_count(count) != 1)
+	if (swap_count(count) != 1 && swap_count(count) != SWAP_MAP_SHMEM)
 		return false;
 
 	while (++map < map_end) {
@@ -1487,7 +1487,10 @@ static bool swap_entries_put_nr(struct s
 	unsigned char count;
 	int i;
 
-	if (nr <= 1 || swap_count(data_race(si->swap_map[offset])) != 1)
+	if (nr <= 1)
+		goto fallback;
+	count = swap_count(data_race(si->swap_map[offset]));
+	if (count != 1 && count != SWAP_MAP_SHMEM)
 		goto fallback;
 	/* cross into another cluster */
 	if (nr > SWAPFILE_CLUSTER - offset % SWAPFILE_CLUSTER)
_

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-05-12  0:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-12  0:50 [merged mm-stable] mm-swap-drop-last-swap_map_shmem-flag-in-batch-in-swap_entries_put_nr.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.