lkml.org 
[lkml]   [2023]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] mm/migrate: Continue to migrate for small pages
Date
migrate_hugetlbs returns -ENOMEM when no enough huge page,
however maybe there are still free small pages, so continue
to migrate for small pages.

Signed-off-by: Chen Wandun <chenwandun@huawei.com>
---
mm/migrate.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/mm/migrate.c b/mm/migrate.c
index b971edbf32fc..c9d0d2058036 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1939,7 +1939,12 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page,

rc_gather = migrate_hugetlbs(from, get_new_page, put_new_page, private,
mode, reason, &stats, &ret_folios);
- if (rc_gather < 0)
+ /* Maybe there are free small pages, continue to migrate.
+ * Nowdays the only negtive return value of migrate_hugetlbs
+ * is -ENOMEM, keep compatible for coming negtive return
+ * value instead of ignore return value.
+ */
+ if (rc_gather < 0 && rc_gather != -ENOMEM)
goto out;
again:
nr_pages = 0;
--
2.25.1
\
 
 \ /
  Last update: 2023-03-27 00:00    [W:0.030 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site