Re: [PATCH] mm/migrate: fix softlockup in do_pages_move() with huge page arrays

From: David Hildenbrand (Arm)

Date: Sat Nov 07 2026 - 13:20:40 EST


On 11/7/26 14:38, shao.mingyin@xxxxxxxxxx wrote:
> From: Shao Mingyin <shao.mingyin@xxxxxxxxxx>
>
> mm/migrate: fix softlockup in do_pages_move() with huge page arrays
>
> do_pages_move() walks the user page array one page at a time. For each
> entry it performs two get_user() calls, an mmap_read_lock()/unlock()
> around a folio walk, and an optional store_status(); none of them has to
> sleep when the arrays stay resident and the rwsem is uncontended.
> move_pages_and_store_status() returns early while the page list is
> empty, so an array whose entries all resolve to the same node can run
> the whole loop without any scheduling point. nr_pages comes straight
> from move_pages(), so a huge array can hold a CPU past the watchdog
> threshold on a non-preemptible kernel; with KASAN and function tracing
> enabled, ten million entries can exceed it.
>
> Add cond_resched() so that long calls yield periodically.
> do_pages_stat() has the same problem and is being fixed separately. In
> current mainline only alpha, hexagon and classic m68k can still select
> PREEMPT_NONE, and they cannot enable CONFIG_NUMA, so this mainly
> targets pre-v7.0 stable kernels.

Please share a real kernel splat from a real system.

--
Cheers,

David