linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/migrate: fix page state accounting type conversion underflow
@ 2021-07-22  5:48 Nicholas Piggin
  2021-07-22  7:27 ` David Hildenbrand
  2021-07-27 16:19 ` Matthew Wilcox
  0 siblings, 2 replies; 6+ messages in thread
From: Nicholas Piggin @ 2021-07-22  5:48 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Nicholas Piggin, Mel Gorman, Yang Shi, linux-mm, Alexey Kardashevskiy

Similarly to commit 2da9f6305f306 ("mm/vmscan: fix NR_ISOLATED_FILE
corruption on 64-bit"), fix -ve int -> unsigned int -> long bug.

Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Fixes: c5fc5c3ae0c84 ("mm: migrate: account THP NUMA migration counters correctly")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 mm/migrate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/migrate.c b/mm/migrate.c
index 34a9ad3e0a4f..7e240437e7d9 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -2068,7 +2068,7 @@ int migrate_misplaced_page(struct page *page, struct vm_area_struct *vma,
 	LIST_HEAD(migratepages);
 	new_page_t *new;
 	bool compound;
-	unsigned int nr_pages = thp_nr_pages(page);
+	int nr_pages = thp_nr_pages(page);
 
 	/*
 	 * PTE mapped THP or HugeTLB page can't reach here so the page could
-- 
2.23.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-07-28 14:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-22  5:48 [PATCH] mm/migrate: fix page state accounting type conversion underflow Nicholas Piggin
2021-07-22  7:27 ` David Hildenbrand
2021-07-22 19:20   ` Andrew Morton
2021-07-26  1:43   ` Nicholas Piggin
2021-07-27 16:19 ` Matthew Wilcox
2021-07-28 14:15   ` Aneesh Kumar K.V

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).