Skip to contentSkip to conversation

mm-migrate-fix-softlockup-in-do_pages_stat-with-huge-page-arrays.patch removed from -mm tree

merged Andrew Morton 1 participant 1 message Nov 7

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/migrate: fix softlockup in do_pages_stat() with huge page arrays
has been removed from the -mm tree. Its filename was
mm-migrate-fix-softlockup-in-do_pages_stat-with-huge-page-arrays.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Qi Xi <[email protected]>
Subject: mm/migrate: fix softlockup in do_pages_stat() with huge page arrays
Date: Sat, 31 Oct 2026 11:33:30 +0800

do_pages_stat() walks the user page array in 16-page chunks but never reschedules, so a huge nr_pages can hold a CPU past the watchdog threshold on non-preemptible kernels. Add cond_resched() to the loop so long move_pages() node-query calls yield periodically.

With KASAN and function tracing enabled, a move_pages() node query (nodes == NULL) over 10 million page entries (~40GB) can trigger the softlockup on a PREEMPT_NONE kernel.

Fixes 80bba1290ab5 ("mm: no get_user/put_user while holding mmap_sem in do_pages_stat?")
Cc David Hildenbrand <[email protected]>
Cc Zi Yan <[email protected]>
Cc Matthew Brost <[email protected]>
Cc Joshua Hahn <[email protected]>
Cc Byungchul Park <[email protected]>
Cc Gregory Price <[email protected]>
Cc Ying Huang <[email protected]>
Cc Alistair Popple <[email protected]>
Cc Qiliang Yuan <[email protected]>
Cc Kefeng Wang <[email protected]>
Cc Nanyong Sun <[email protected]>

---

 mm/migrate.c |    1 +
 1 file changed, 1 insertion(+)
mm/migrate.c renamed from mm/migrate.c~mm-migrate-fix-softlockup-in-do_pages_stat-with-huge-page-arrays +1 -0
@@ -2555,6 +2555,7 @@ static int do_pages_stat(struct mm_struc
 
 		chunk_offset += chunk_nr;
 		nr_pages -= chunk_nr;
+		cond_resched();
 	}
 	return nr_pages ? -EFAULT : 0;
 }

_

Patches currently in -mm which might be from [email protected] are