From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: David Hildenbrand <david@redhat.com>,
Matthew Wilcox <willy@infradead.org>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
Zi Yan <ziy@nvidia.com>, Alistair Popple <apopple@nvidia.com>,
Jonathan Corbet <corbet@lwn.net>, <linux-mm@kvack.org>,
Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: [PATCH 5-fix/6] mm: remove isolate_lru_page() fix
Date: Mon, 26 Aug 2024 22:41:14 +0800 [thread overview]
Message-ID: <20240826144114.1928071-1-wangkefeng.wang@huawei.com> (raw)
In-Reply-To: <20240826065814.1336616-6-wangkefeng.wang@huawei.com>
Convert page to folio in comment and document, per Matthew.
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
Andrew,
Please help to squash this fix into [PATCH 5/6] mm: remove isolate_lru_page().
Documentation/mm/page_migration.rst | 18 +++++++++---------
Documentation/mm/unevictable-lru.rst | 2 +-
mm/khugepaged.c | 2 +-
mm/migrate_device.c | 4 ++--
mm/swap.c | 4 ++--
5 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/Documentation/mm/page_migration.rst b/Documentation/mm/page_migration.rst
index 0046bbbdc65d..519b35a4caf5 100644
--- a/Documentation/mm/page_migration.rst
+++ b/Documentation/mm/page_migration.rst
@@ -63,15 +63,15 @@ and then a low level description of how the low level details work.
In kernel use of migrate_pages()
================================
-1. Remove pages from the LRU.
+1. Remove folios from the LRU.
- Lists of pages to be migrated are generated by scanning over
- pages and moving them into lists. This is done by
+ Lists of folios to be migrated are generated by scanning over
+ folios and moving them into lists. This is done by
calling folio_isolate_lru().
- Calling folio_isolate_lru() increases the references to the page
- so that it cannot vanish while the page migration occurs.
+ Calling folio_isolate_lru() increases the references to the folio
+ so that it cannot vanish while the folio migration occurs.
It also prevents the swapper or other scans from encountering
- the page.
+ the folio.
2. We need to have a function of type new_folio_t that can be
passed to migrate_pages(). This function should figure out
@@ -84,10 +84,10 @@ In kernel use of migrate_pages()
How migrate_pages() works
=========================
-migrate_pages() does several passes over its list of pages. A page is moved
-if all references to a page are removable at the time. The page has
+migrate_pages() does several passes over its list of folios. A folio is moved
+if all references to a folio are removable at the time. The folio has
already been removed from the LRU via folio_isolate_lru() and the refcount
-is increased so that the page cannot be freed while page migration occurs.
+is increased so that the folio cannot be freed while folio migration occurs.
Steps:
diff --git a/Documentation/mm/unevictable-lru.rst b/Documentation/mm/unevictable-lru.rst
index 04113c2a2f9e..8d11fe6a0854 100644
--- a/Documentation/mm/unevictable-lru.rst
+++ b/Documentation/mm/unevictable-lru.rst
@@ -80,7 +80,7 @@ on an additional LRU list for a few reasons:
(2) We want to be able to migrate unevictable folios between nodes for memory
defragmentation, workload management and memory hotplug. The Linux kernel
can only migrate folios that it can successfully isolate from the LRU
- lists (or "Movable" pages: outside of consideration here). If we were to
+ lists (or "Movable" folios: outside of consideration here). If we were to
maintain folios elsewhere than on an LRU-like list, where they can be
detected by folio_isolate_lru(), we would prevent their migration.
diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index b87eacfac5a7..ab646018ce25 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -628,7 +628,7 @@ static int __collapse_huge_page_isolate(struct vm_area_struct *vma,
/*
* We can do it before folio_isolate_lru because the
- * page can't be freed from under us. NOTE: PG_lock
+ * folio can't be freed from under us. NOTE: PG_lock
* is needed to serialize against split_huge_page
* when invoked from the VM.
*/
diff --git a/mm/migrate_device.c b/mm/migrate_device.c
index f1faff058491..8d687de88a03 100644
--- a/mm/migrate_device.c
+++ b/mm/migrate_device.c
@@ -328,8 +328,8 @@ static bool migrate_vma_check_page(struct page *page, struct page *fault_page)
/*
* One extra ref because caller holds an extra reference, either from
- * folio_isolate_lru() for a regular page, or migrate_vma_collect() for
- * a device page.
+ * folio_isolate_lru() for a regular folio, or migrate_vma_collect() for
+ * a device folio.
*/
int extra = 1 + (page == fault_page);
diff --git a/mm/swap.c b/mm/swap.c
index 634fde80cd44..510573d7e82e 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -906,8 +906,8 @@ atomic_t lru_disable_count = ATOMIC_INIT(0);
/*
* lru_cache_disable() needs to be called before we start compiling
- * a list of pages to be migrated using folio_isolate_lru().
- * It drains pages on LRU cache and then disable on all cpus until
+ * a list of folios to be migrated using folio_isolate_lru().
+ * It drains folios on LRU cache and then disable on all cpus until
* lru_cache_enable is called.
*
* Must be paired with a call to lru_cache_enable().
--
2.27.0
next prev parent reply other threads:[~2024-08-26 14:41 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-26 6:58 [PATCH 0/6] mm: finish isolate/putback_lru_page() Kefeng Wang
2024-08-26 6:58 ` [PATCH 1/6] mm: migrate_device: convert to migrate_device_coherent_folio() Kefeng Wang
2024-08-26 15:04 ` David Hildenbrand
2024-08-26 17:52 ` Vishal Moola
2024-08-27 5:42 ` Alistair Popple
2024-08-26 6:58 ` [PATCH 2/6] mm: migrate_device: use a folio in migrate_device_range() Kefeng Wang
2024-08-26 15:05 ` David Hildenbrand
2024-08-26 17:53 ` Vishal Moola
2024-08-27 5:46 ` Alistair Popple
2024-08-26 6:58 ` [PATCH 3/6] mm: migrate_device: use more folio in migrate_device_unmap() Kefeng Wang
2024-08-26 15:06 ` David Hildenbrand
2024-08-26 17:53 ` Vishal Moola
2024-08-27 5:47 ` Alistair Popple
2024-08-26 6:58 ` [PATCH 4/6] mm: migrate_device: use more folio in migrate_device_finalize() Kefeng Wang
2024-08-26 17:53 ` Vishal Moola
2024-08-27 5:48 ` Alistair Popple
2024-08-26 6:58 ` [PATCH 5/6] mm: remove isolate_lru_page() Kefeng Wang
2024-08-26 13:05 ` Matthew Wilcox
2024-08-26 13:52 ` Kefeng Wang
2024-08-26 14:41 ` Kefeng Wang [this message]
2024-08-26 17:54 ` [PATCH 5-fix/6] mm: remove isolate_lru_page() fix Vishal Moola
2024-08-26 6:58 ` [PATCH 6/6] mm: remove putback_lru_page() Kefeng Wang
2024-08-26 15:08 ` David Hildenbrand
2024-08-26 17:54 ` Vishal Moola
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240826144114.1928071-1-wangkefeng.wang@huawei.com \
--to=wangkefeng.wang@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=baolin.wang@linux.alibaba.com \
--cc=corbet@lwn.net \
--cc=david@redhat.com \
--cc=linux-mm@kvack.org \
--cc=willy@infradead.org \
--cc=ziy@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).