2021-04-14 06:56:18

by Yang Shi

[permalink] [raw]
Subject: [v2 PATCH 5/7] mm: migrate: don't split THP for misplaced NUMA page

The old behavior didn't split THP if migration is failed due to lack of
memory on the target node. But the THP migration does split THP, so keep
the old behavior for misplaced NUMA page migration.

Signed-off-by: Yang Shi <[email protected]>
---
mm/migrate.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/migrate.c b/mm/migrate.c
index a473f25fbd01..a72994c68ec6 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1417,6 +1417,7 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page,
int swapwrite = current->flags & PF_SWAPWRITE;
int rc, nr_subpages;
LIST_HEAD(ret_pages);
+ bool nosplit = (reason == MR_NUMA_MISPLACED);

trace_mm_migrate_pages_start(mode, reason);

@@ -1488,8 +1489,9 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page,
/*
* When memory is low, don't bother to try to migrate
* other pages, just exit.
+ * THP NUMA faulting doesn't split THP to retry.
*/
- if (is_thp) {
+ if (is_thp && !nosplit) {
if (!try_split_thp(page, &page2, from)) {
nr_thp_split++;
goto retry;
--
2.26.2


2021-05-18 14:39:47

by Mel Gorman

[permalink] [raw]
Subject: Re: [v2 PATCH 5/7] mm: migrate: don't split THP for misplaced NUMA page

On Tue, Apr 13, 2021 at 02:24:14PM -0700, Yang Shi wrote:
> The old behavior didn't split THP if migration is failed due to lack of
> memory on the target node. But the THP migration does split THP, so keep
> the old behavior for misplaced NUMA page migration.
>
> Signed-off-by: Yang Shi <[email protected]>

Acked-by: Mel Gorman <[email protected]>

--
Mel Gorman
SUSE Labs