mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Zi Yan <ziy@nvidia.com>,
	shao.mingyin@zte.com.cn, akpm@linux-foundation.org
Cc: linux-mm@kvack.org, matthew.brost@intel.com,
	joshua.hahnjy@gmail.com, byungchul@sk.com, gourry@gourry.net,
	ying.huang@linux.alibaba.com, apopple@nvidia.com,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] mm/migrate: fix softlockup in do_pages_move() with huge page arrays
Date: Sat, 7 Nov 2026 20:11:22 +0100	[thread overview]
Message-ID: <bc095bd8-ee9f-4bab-8333-8f2333b2590a@kernel.org> (raw)
In-Reply-To: <DMP795RB75PQ.1XIZ1QUJ51Y0H@nvidia.com>

On 11/7/26 19:45, Zi Yan wrote:
> On Sat Nov 7, 2026 at 8:38 AM EST,  wrote:
>> From: Shao Mingyin <shao.mingyin@zte.com.cn>
>>
>> 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.
> 
> This is probably in the same spirit as the do_pages_stat() patch[1][2].

Right, and I'd like to see an actual reproducer, because we sure have a bunch of
cond_resched() already in migration code.

-- 
Cheers,

David

      reply	other threads:[~2026-11-07 19:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-07 13:38 shao.mingyin
2026-11-07 18:20 ` David Hildenbrand (Arm)
2026-11-07 18:45 ` Zi Yan
2026-11-07 19:11   ` David Hildenbrand (Arm) [this message]

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=bc095bd8-ee9f-4bab-8333-8f2333b2590a@kernel.org \
    --to=david@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=apopple@nvidia.com \
    --cc=byungchul@sk.com \
    --cc=gourry@gourry.net \
    --cc=joshua.hahnjy@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=matthew.brost@intel.com \
    --cc=shao.mingyin@zte.com.cn \
    --cc=stable@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®