Skip to contentSkip to conversation

mm-swap-remove-old-allocation-path-for-hdd.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Jan 16, 2025

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm, swap: remove old allocation path for HDD
has been removed from the -mm tree. Its filename was
mm-swap-remove-old-allocation-path-for-hdd.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: Kairui Song <[email protected]>
Subject: mm, swap: remove old allocation path for HDD
Date: Tue, 14 Jan 2025 01:57:22 +0800

We are currently using different swap allocation algorithm for HDD and non-HDD. This leads to the existence of a different set of locks, and the code path is heavily bloated, causing difficulties for further optimization and maintenance.

This commit removes all HDD swap allocation and related dead code, and uses the cluster allocation algorithm instead.

The performance may drop temporarily, but this should be negligible: The main advantage of the legacy HDD allocation algorithm is that it tends to use continuous slots, but swap device gets fragmented quickly anyway, and the attempt to use continuous slots will fail easily.

This commit also enables mTHP swap on HDD, which is expected to be beneficial, and following commits will adapt and optimize the cluster allocator for HDD.

---

 include/linux/swap.h |    3 
 mm/swapfile.c        |  235 +----------------------------------------
 2 files changed, 9 insertions(+), 229 deletions(-)
include/linux/swap.h renamed from include/linux/swap.h~mm-swap-remove-old-allocation-path-for-hdd +0 -3
@@ -309,9 +309,6 @@ struct swap_info_struct {
 	unsigned int highest_bit;	/* index of last free in swap_map */
 	unsigned int pages;		/* total of usable pages of swap */
 	unsigned int inuse_pages;	/* number of those currently in use */
-	unsigned int cluster_next;	/* likely index for next allocation */
-	unsigned int cluster_nr;	/* countdown to next cluster search */
-	unsigned int __percpu *cluster_next_cpu; /*percpu index for next allocation */
 	struct percpu_cluster __percpu *percpu_cluster; /* per cpu's swap location */
 	struct rb_root swap_extent_root;/* root of the swap extent rbtree */
 	struct block_device *bdev;	/* swap device or bdev of swap file */
mm/swapfile.c renamed from mm/swapfile.c~mm-swap-remove-old-allocation-path-for-hdd +9 -226

307 lines not on this page · raw message

_

Patches currently in -mm which might be from [email protected] are