mm/migrate: fix NR_ISOLATED corruption on 64-bit
Subsystems (2)
PATCH 1/1 mm/migrate: fix NR_ISOLATED corruption on 64-bit
Similar to commit 2da9f6305f30 ("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)))".
--- mm/migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/migrate.c +1 -1
@@ -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
Signature · 1 line
2.31.1
Quoted 22 lines · Aneesh Kumar K.V
Similar to commit
2da9f6305f30("mm/vmscan: fixNR_ISOLATED_FILEcorruption on 64-bit") avoid using unsigned int fornr_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)))".Fixes c5fc5c3ae0c8 ("mm: migrate: account THP NUMA migration counters correctly")Cc Yang Shi <[email protected]>Reported-by Michael Ellerman <[email protected]>Signed-off-by Aneesh Kumar K.V <[email protected]>--- mm/migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mm/migrate.c +0
-0
mm/migrate.c int migrate_misplaced_page(struct page *page, struct vm_area_struct *vma, · line 2074
Quoted 8 lines
mm/migrate.c +1
-1@@ -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
Already posted:
https://lkml.kernel.org/r/[email protected]
but this patch description is a lot better.
Signature · 3 lines
Thanks, David / dhildenb
Quoted 5 lines · Aneesh Kumar K.V
Similar to commit
2da9f6305f30("mm/vmscan: fixNR_ISOLATED_FILEcorruption on 64-bit") avoid using unsigned int fornr_pages. With unsigned int type the large unsigned int converts to a large positive signed long.
Quoted 8 lines
Symptoms include CMA allocations hanging forever
due to alloc_contig_range->...->isolate_migratepages_block waiting forever in "while (unlikely(too_many_isolated(pgdat)))".Fixes c5fc5c3ae0c8 ("mm: migrate: account THP NUMA migration counters correctly")Cc Yang Shi <[email protected]>Reported-by Michael Ellerman <[email protected]>Signed-off-by Aneesh Kumar K.V <[email protected]>
It seems Andrew picked this one. Either one is fine to me.
Quoted 20 lines
--- mm/migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mm/migrate.c +1
-2@@ -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.31.1