From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,ziy@nvidia.com,ying.huang@linux.alibaba.com,
wangkefeng.wang@huawei.com,sunnanyong@huawei.com,stable@vger.kernel.org,
odys.yuan@gmail.com,matthew.brost@intel.com,joshua.hahnjy@gmail.com,
gourry@gourry.net,david@kernel.org,byungchul@sk.com,apopple@nvidia.com,
xiqi2@huawei.com,akpm@linux-foundation.org
Subject: + mm-migrate-fix-softlockup-in-do_pages_stat-with-huge-page-arrays.patch added to mm-new branch
Date: Sun, 01 Nov 2026 11:48:42 -0800 [thread overview]
Message-ID: <20261101194842.7DF261F000C1@smtp.kernel.org> (raw)
The patch titled
Subject: mm/migrate: fix softlockup in do_pages_stat() with huge page arrays
has been added to the -mm mm-new branch. Its filename is
mm-migrate-fix-softlockup-in-do_pages_stat-with-huge-page-arrays.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-migrate-fix-softlockup-in-do_pages_stat-with-huge-page-arrays.patch
This patch will later appear in the mm-new branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Note, mm-new is a provisional staging ground for work-in-progress
patches, and acceptance into mm-new is a notification for others take
notice and to finish up reviews. Please do not hesitate to respond to
review feedback and post updated versions to replace or incrementally
fixup patches in mm-new.
The mm-new branch of mm.git is not included in linux-next
If a few days of testing in mm-new is successful, the patch will me moved
into mm.git's mm-unstable branch, which is included in linux-next
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Qi Xi <xiqi2@huawei.com>
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.
Link: https://lore.kernel.org/20261031033330.3416326-1-xiqi5703@163.com
Fixes: 80bba1290ab5 ("mm: no get_user/put_user while holding mmap_sem in do_pages_stat?")
Signed-off-by: Qi Xi <xiqi2@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: Zi Yan <ziy@nvidia.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Joshua Hahn <joshua.hahnjy@gmail.com>
Cc: Byungchul Park <byungchul@sk.com>
Cc: Gregory Price <gourry@gourry.net>
Cc: Ying Huang <ying.huang@linux.alibaba.com>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Qiliang Yuan <odys.yuan@gmail.com>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Nanyong Sun <sunnanyong@huawei.com>
Cc: <stable@vger.kernel.org>
---
mm/migrate.c | 1 +
1 file changed, 1 insertion(+)
--- a/mm/migrate.c~mm-migrate-fix-softlockup-in-do_pages_stat-with-huge-page-arrays
+++ a/mm/migrate.c
@@ -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 xiqi2@huawei.com are
mm-migrate-fix-softlockup-in-do_pages_stat-with-huge-page-arrays.patch
reply other threads:[~2026-11-01 19:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261101194842.7DF261F000C1@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=byungchul@sk.com \
--cc=david@kernel.org \
--cc=gourry@gourry.net \
--cc=joshua.hahnjy@gmail.com \
--cc=matthew.brost@intel.com \
--cc=mm-commits@vger.kernel.org \
--cc=odys.yuan@gmail.com \
--cc=stable@vger.kernel.org \
--cc=sunnanyong@huawei.com \
--cc=wangkefeng.wang@huawei.com \
--cc=xiqi2@huawei.com \
--cc=ying.huang@linux.alibaba.com \
--cc=ziy@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.