Skip to content

Commit b5916c0

Browse files
kvaneeshtorvalds
authored andcommitted
mm/migrate: fix NR_ISOLATED corruption on 64-bit
Similar to commit 2da9f63 ("mm/vmscan: fix NR_ISOLATED_FILE corruption on 64-bit") avoid using unsigned int for nr_pages. With unsigned int type the large unsigned int converts to a large positive signed long. Symptoms include CMA allocations hanging forever due to alloc_contig_range->...->isolate_migratepages_block waiting forever in "while (unlikely(too_many_isolated(pgdat)))". Link: https://lkml.kernel.org/r/[email protected] Fixes: c5fc5c3 ("mm: migrate: account THP NUMA migration counters correctly") Signed-off-by: Aneesh Kumar K.V <[email protected]> Reported-by: Michael Ellerman <[email protected]> Reported-by: Alexey Kardashevskiy <[email protected]> Reviewed-by: Yang Shi <[email protected]> Cc: Mel Gorman <[email protected]> Cc: Nicholas Piggin <[email protected]> Cc: David Hildenbrand <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 30def93 commit b5916c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/migrate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2068,7 +2068,7 @@ int migrate_misplaced_page(struct page *page, struct vm_area_struct *vma,
20682068
LIST_HEAD(migratepages);
20692069
new_page_t *new;
20702070
bool compound;
2071-
unsigned int nr_pages = thp_nr_pages(page);
2071+
int nr_pages = thp_nr_pages(page);
20722072

20732073
/*
20742074
* PTE mapped THP or HugeTLB page can't reach here so the page could

0 commit comments

Comments
 (0)