From: Qiliang Yuan <odys.yuan@gmail.com>
To: Zi Yan <ziy@nvidia.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@kernel.org>,
Matthew Brost <matthew.brost@intel.com>,
Joshua Hahn <joshua.hahnjy@gmail.com>,
Byungchul Park <byungchul@sk.com>,
Gregory Price <gourry@gourry.net>,
Ying Huang <ying.huang@linux.alibaba.com>,
Alistair Popple <apopple@nvidia.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/migrate: look up consecutive pages together in do_pages_stat_array()
Date: Fri, 2 Oct 2026 09:27:37 +0800 [thread overview]
Message-ID: <20261002012737.149491-1-odys.yuan@gmail.com> (raw)
In-Reply-To: <4CCA725B-9CFE-4ADF-AE8A-59D6ECA4321F@nvidia.com>
On 1 Oct 2026, at 11:37, Zi Yan wrote:
> Instead of adding customized batched walk code, it might be better to use
> walk_page_range() + pmd_entry callback. See mincore_pte_range() for
> reference.
Thanks, v2 does that, with pud_entry and hugetlb_entry callbacks so the
walk doesn't split PUD or hugetlb leaves.
> BTW, DO_PAGES_STAT_CHUNK_NR is limited at 16, so the batching benefit
> comes from 16 pages instead of 512 pages in one PMD? I wonder if that
> limit could be raised and how much more benefit we will see.
Yes. With runs walked in one go, the walk setup paid every 16 pages
dominates. Per page, querying a populated 4 GiB buffer:
16 64 256 512 1024
4K pages 31.9 ns 15.0 ns 11.8 ns 11.2 ns 10.9 ns
THP 23.1 ns 6.6 ns 2.5 ns 1.8 ns 1.6 ns
v2 raises the chunk to 512 in a separate patch, which also allocates
the arrays instead of keeping 6 KiB on the stack:
https://lore.kernel.org/r/20261002-bug-mm-move-pages-stat-batch-v2-0-f73b5d20519f@gmail.com
Qiliang
prev parent reply other threads:[~2026-10-02 1:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-01 15:10 Qiliang Yuan
2026-10-01 15:37 ` Zi Yan
2026-10-02 1:27 ` Qiliang Yuan [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=20261002012737.149491-1-odys.yuan@gmail.com \
--to=odys.yuan@gmail.com \
--cc=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=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=matthew.brost@intel.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 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®