[PATCH v4 2/3] mm: rename swap.c to folio_lru.c
From: Jianyue Wu
Date: Wed Jun 03 2026 - 09:15:22 EST
Rename mm/swap.c to mm/folio_lru.c so the filename better matches
the code's main responsibility.
This keeps the implementation split from swap-specific code without
changing the published LRU helper interfaces.
Update MAINTAINERS and the remaining mm/swap.c documentation references
after the rename.
Suggested-by: Baoquan He <bhe@xxxxxxxxxx>
Suggested-by: David Hildenbrand <david@xxxxxxxxxx>
Signed-off-by: Jianyue Wu <wujianyue000@xxxxxxxxx>
---
Documentation/admin-guide/sysctl/vm.rst | 3 ---
Documentation/core-api/mm-api.rst | 2 +-
MAINTAINERS | 3 +--
mm/Makefile | 2 +-
mm/{swap.c => folio_lru.c} | 10 +++-------
5 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/Documentation/admin-guide/sysctl/vm.rst b/Documentation/admin-guide/sysctl/vm.rst
index 97e12359775c..2b9513371324 100644
--- a/Documentation/admin-guide/sysctl/vm.rst
+++ b/Documentation/admin-guide/sysctl/vm.rst
@@ -19,9 +19,6 @@ The files in this directory can be used to tune the operation
of the virtual memory (VM) subsystem of the Linux kernel and
the writeout of dirty data to disk.
-Default values and initialization routines for most of these
-files can be found in mm/swap.c.
-
Currently, these files are in /proc/sys/vm:
- admin_reserve_kbytes
diff --git a/Documentation/core-api/mm-api.rst b/Documentation/core-api/mm-api.rst
index aabdd3cba58e..d6d189b9a996 100644
--- a/Documentation/core-api/mm-api.rst
+++ b/Documentation/core-api/mm-api.rst
@@ -117,7 +117,7 @@ More Memory Management Functions
.. #kernel-doc:: mm/hmm.c (build warnings)
.. kernel-doc:: mm/memremap.c
.. kernel-doc:: mm/hugetlb.c
-.. kernel-doc:: mm/swap.c
+.. kernel-doc:: mm/folio_lru.c
.. kernel-doc:: mm/memcontrol.c
.. #kernel-doc:: mm/memory-tiers.c (build warnings)
.. kernel-doc:: mm/shmem.c
diff --git a/MAINTAINERS b/MAINTAINERS
index e3ee97f5474e..6bd39e0afceb 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -16900,7 +16900,7 @@ F: Documentation/admin-guide/mm/multigen_lru.rst
F: Documentation/mm/multigen_lru.rst
F: include/linux/mm_inline.h
F: include/linux/mmzone.h
-F: mm/swap.c
+F: mm/folio_lru.c
F: mm/vmscan.c
F: mm/workingset.c
@@ -17045,7 +17045,6 @@ F: include/linux/swap.h
F: include/linux/swapfile.h
F: include/linux/swapops.h
F: mm/page_io.c
-F: mm/swap.c
F: mm/swap.h
F: mm/swap_table.h
F: mm/swap_state.c
diff --git a/mm/Makefile b/mm/Makefile
index eff9f9e7e061..5f712f9bbe73 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -50,7 +50,7 @@ endif
obj-y := filemap.o mempool.o oom_kill.o fadvise.o \
maccess.o page-writeback.o folio-compat.o \
- readahead.o swap.o truncate.o vmscan.o shrinker.o \
+ readahead.o folio_lru.o truncate.o vmscan.o shrinker.o \
shmem.o util.o mmzone.o vmstat.o backing-dev.o \
mm_init.o percpu.o slab_common.o \
compaction.o show_mem.o \
diff --git a/mm/swap.c b/mm/folio_lru.c
similarity index 99%
rename from mm/swap.c
rename to mm/folio_lru.c
index e4b3dadaa6dc..46924a797ead 100644
--- a/mm/swap.c
+++ b/mm/folio_lru.c
@@ -1,17 +1,13 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
- * linux/mm/swap.c
+ * linux/mm/folio_lru.c
*
* Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
*/
/*
- * This file contains the default values for the operation of the
- * Linux VM subsystem. Fine-tuning documentation can be found in
- * Documentation/admin-guide/sysctl/vm.rst.
- * Started 18.12.91
- * Swap aging added 23.2.95, Stephen Tweedie.
- * Buffermem limits added 12.3.98, Rik van Riel.
+ * Folio LRU helpers: add/remove folios from LRU lists, batching,
+ * activation/deactivation, and page cache release paths.
*/
#include <linux/mm.h>
--
2.43.0