From: "Huang, Ying" <ying.huang@linux.alibaba.com>
To: Zhiteng Qiu <qiuzhiteng@hygon.cn>
Cc: David Hildenbrand <david@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Zi Yan <ziy@nvidia.com>,
Matthew Brost <matthew.brost@intel.com>,
Joshua Hahn <joshua.hahnjy@gmail.com>,
Byungchul Park <byungchul@sk.com>,
Gregory Price <gourry@gourry.net>,
Alistair Popple <apopple@nvidia.com>,
Xin Hao <xhao@linux.alibaba.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
Yuan Zhong <zhongyuan@hygon.cn>, Shifei Ge <geshifei@hygon.cn>,
Jianyong Wu <wujianyong@hygon.cn>,
Shijie Huang <huangsj@hygon.cn>, Yibin Liu <liuyibin@hygon.cn>,
Fengyu Wang <wangfengyu@hygon.cn>, <linux-mm@kvack.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] mm/migrate: don't batch the TLB flush when there is nothing to batch
Date: Tue, 10 Nov 2026 09:41:18 +0800 [thread overview]
Message-ID: <8733t9v4xt.fsf@DESKTOP-5N7EMDA> (raw)
In-Reply-To: <20261110001816.2186986-1-qiuzhiteng@hygon.cn> (Zhiteng Qiu's message of "Tue, 10 Nov 2026 00:18:16 +0800")
Zhiteng Qiu <qiuzhiteng@hygon.cn> writes:
> On 11/9/26 14:07, David Hildenbrand (Arm) wrote:
[snip]
>> I am not quite happy about the folio_mapcount() check, though: as soon as we
>> optimize try_to_unmap() to batch better for large folios, it would be just plain
>> wrong.
>
> That makes sense. A large folio's mapcount alone would not tell us
> how many separate flushes are needed once its PTEs can be handled
> in a batch.
>
> Would it make sense to restrict the optimization to a single,
> singly mapped small folio and keep batching for all large folios,
> as in the scope of v2? The changelog performance numbers were
> measured with the v2 check. Or do you have a different direction
> in mind?
If there's any behavior change, please rerun the test to verify. It's
fine to reuse the result data if they are similar enough.
>
> Moving the check to the caller would read the mapcount before
> locking the folio. My understanding is that a concurrent change
> could only affect which flush path is chosen, and both paths are
> correct. Please let me know if I'm missing a concurrency concern.
>
> Ying, since you suggested using folio_mapcount(), would you be
> comfortable with limiting the optimization to small folios?
I'm OK with it. Thanks to David for pointing out that folio_mapcount()
isn't good here because we will optimize large folio tlb flushes.
[snip]
---
Best Regards,
Huang, Ying
prev parent reply other threads:[~2026-11-10 1:41 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 4:16 [PATCH] " Zhiteng Qiu
2026-11-06 9:37 ` Huang, Ying
2026-11-06 10:09 ` Zhiteng Qiu
2026-11-06 17:50 ` Zhiteng Qiu
2026-11-07 6:54 ` Huang, Ying
2026-11-07 11:07 ` Zhiteng Qiu
2026-11-07 12:22 ` Huang, Ying
2026-11-07 12:26 ` Huang, Ying
2026-11-07 14:34 ` [PATCH v2] " Zhiteng Qiu
2026-11-08 12:52 ` Huang, Ying
2026-11-08 14:42 ` Zi Yan
2026-11-09 12:29 ` [PATCH v3] " Zhiteng Qiu
2026-11-09 13:07 ` David Hildenbrand (Arm)
2026-11-09 16:18 ` Zhiteng Qiu
2026-11-09 20:36 ` David Hildenbrand (Arm)
2026-11-10 1:41 ` Huang, Ying [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=8733t9v4xt.fsf@DESKTOP-5N7EMDA \
--to=ying.huang@linux.alibaba.com \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=byungchul@sk.com \
--cc=dave.hansen@linux.intel.com \
--cc=david@kernel.org \
--cc=geshifei@hygon.cn \
--cc=gourry@gourry.net \
--cc=huangsj@hygon.cn \
--cc=joshua.hahnjy@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liuyibin@hygon.cn \
--cc=matthew.brost@intel.com \
--cc=qiuzhiteng@hygon.cn \
--cc=wangfengyu@hygon.cn \
--cc=wujianyong@hygon.cn \
--cc=xhao@linux.alibaba.com \
--cc=zhongyuan@hygon.cn \
--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®