VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   33 Branches   55 Tags
author: Baolin Wang <baolin.wang@linux.alibaba.com> 2021-09-08 15:18:01 -0700 committer: Linus Torvalds <torvalds@linux-foundation.org> 2021-09-08 15:32:34 -0700 commit: 2b9b624f5aef6af608edf541fed973948e27004c parent: c68ed7945701a38f2121ed74e23ff19c2052b4c2
Commit Summary:
mm: migrate: introduce a local variable to get the number of pages
Diffstat:
1 file changed, 3 insertions, 2 deletions
diff --git a/mm/migrate.c b/mm/migrate.c
index a0aeb3fe46a7..d6617f8e546d 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -2107,6 +2107,7 @@ out:
 static int numamigrate_isolate_page(pg_data_t *pgdat, struct page *page)
 {
 	int page_lru;
+	int nr_pages = thp_nr_pages(page);
 
 	VM_BUG_ON_PAGE(compound_order(page) && !PageTransHuge(page), page);
 
@@ -2115,7 +2116,7 @@ static int numamigrate_isolate_page(pg_data_t *pgdat, struct page *page)
 		return 0;
 
 	/* Avoid migrating to a node that is nearly full */
-	if (!migrate_balanced_pgdat(pgdat, compound_nr(page)))
+	if (!migrate_balanced_pgdat(pgdat, nr_pages))
 		return 0;
 
 	if (isolate_lru_page(page))
@@ -2123,7 +2124,7 @@ static int numamigrate_isolate_page(pg_data_t *pgdat, struct page *page)
 
 	page_lru = page_is_file_lru(page);
 	mod_node_page_state(page_pgdat(page), NR_ISOLATED_ANON + page_lru,
-				thp_nr_pages(page));
+			    nr_pages);
 
 	/*
 	 * Isolating the page has taken another reference, so the