From: "Garg, Shivank" <shivankg@amd.com>
To: "ravis.opensrc@gmail.com" <ravis.opensrc@gmail.com>
Cc: "ying.huang@linux.alibaba.com" <ying.huang@linux.alibaba.com>,
"riel@surriel.com" <riel@surriel.com>,
"usama.arif@linux.dev" <usama.arif@linux.dev>,
"david@kernel.org" <david@kernel.org>,
"mhocko@suse.com" <mhocko@suse.com>,
"joshua.hahnjy@gmail.com" <joshua.hahnjy@gmail.com>,
"rientjes@google.com" <rientjes@google.com>,
"kinseyho@google.com" <kinseyho@google.com>,
"kmanaouil.dev@gmail.com" <kmanaouil.dev@gmail.com>,
"lance.yang@linux.dev" <lance.yang@linux.dev>,
"weixugc@google.com" <weixugc@google.com>,
"liam@infradead.org" <liam@infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"gourry@gourry.net" <gourry@gourry.net>,
"jannh@google.com" <jannh@google.com>,
"Rao, Bharata Bhasker" <bharata@amd.com>,
"byungchul@sk.com" <byungchul@sk.com>,
"rppt@kernel.org" <rppt@kernel.org>,
"dev.jain@arm.com" <dev.jain@arm.com>,
"surenb@google.com" <surenb@google.com>,
"fvdl@google.com" <fvdl@google.com>,
"matthew.brost@intel.com" <matthew.brost@intel.com>,
"rakie.kim@sk.com" <rakie.kim@sk.com>,
"harry@kernel.org" <harry@kernel.org>,
"apopple@nvidia.com" <apopple@nvidia.com>,
"ziy@nvidia.com" <ziy@nvidia.com>,
"vbabka@kernel.org" <vbabka@kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"ljs@kernel.org" <ljs@kernel.org>,
"linmiaohe@huawei.com" <linmiaohe@huawei.com>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"joannelkoong@gmail.com" <joannelkoong@gmail.com>
Subject: Re: [PATCH v3 0/3] mm/rmap: batch the unmap of large folios during migration
Date: Tue, 1 Dec 2026 09:46:04 +0000 [thread overview]
Message-ID: <ce3acf3fe914950ad80fb66e14b3f2864f405cd6.camel@amd.com> (raw)
In-Reply-To: <20261130200227.82773-1-ravis.opensrc@gmail.com>
On Mon, 2026-11-30 at 12:02 -0800, Ravi Jonnalagadda wrote:
> On Thu, 26 Nov 2026 09:53:00 +0000, Shivank Garg wrote:
> > This series lets try_to_migrate_one() convert a batch of consecutive PTEs
> > that map the same large folio in one go, mirroring what
> > try_to_unmap_one() already does, with some refactoring on the way.
>
> Hi Shivank,
>
> I tested v3 on an AMD EPYC system, migrating between DRAM and CXL
> memory. The gains have the shape of your Zen5 table.
>
> How I tested
> ------------
> - An AMD EPYC system with DRAM and a CXL Type 3 memory expander,
> booted with mitigations=off as in your runs.
> - Base kernel: your base, mm-core for-next 518cbccb58e4 with Dev's
> v5 [1]. Each result compares it without and with v3.
> - move_pages() of 1 GiB of anonymous memory, one mTHP size at a time,
> between DRAM and CXL in both directions.
> - GB/s = 1 GiB / wall time of the move_pages() call. Every word is
> checked after each move.
>
> What I saw
> ----------
> On the base kernel:
>
> folio | without v3 | with v3 | gain | try_to_migrate() ms
> ------+------------+------------+---------+--------------------
> 4K | 4.77 GB/s | 4.81 GB/s | +0.9 % | 42.5 -> 41.6
> 16K | 7.28 GB/s | 8.36 GB/s | +14.8 % | 35.2 -> 19.4
> 64K | 9.18 GB/s | 11.18 GB/s | +21.9 % | 34.4 -> 15.3
> 256K | 9.66 GB/s | 13.22 GB/s | +36.9 % | 36.1 -> 6.4
> 1M | 10.15 GB/s | 13.54 GB/s | +33.5 % | 32.9 -> 6.0
> 2M | 17.61 GB/s | 17.30 GB/s | -1.7 % | 0.33 -> 0.32
>
> - try_to_migrate() time drops the same way as in your profile.
> - 2M is PMD-mapped and unchanged within noise.
>
> With the copy offloaded to DMA, the batching matters more, as your v2
> cover expected. For this I used an offload kernel: the base kernel
> plus your offload series v6, with dcbm holding its DMA channels while
> offloading is enabled (results in [2], code in [3]), on an AMD SDXI
> engine. On the offload kernel, CPU copy and DMA copy, each without
> and with v3:
>
> folio | copy | without v3 | with v3 | gain
> ------+------+------------+------------+--------
> 256K | CPU | 9.73 GB/s | 12.31 GB/s | +26.5 %
> 256K | DMA | 15.53 GB/s | 23.83 GB/s | +53.5 %
> 1M | CPU | 10.08 GB/s | 12.66 GB/s | +25.5 %
> 1M | DMA | 16.21 GB/s | 25.54 GB/s | +57.6 %
>
> The offload kernel moves the whole 1 GiB in one batch (v6 5/5), so
> its CPU numbers are not comparable with the base kernel's table.
>
> Tested-by: Ravi Jonnalagadda <ravis.opensrc@gmail.com>
>
Thank you for detailed testing and numbers.
Best regards,
Shivank
prev parent reply other threads:[~2026-12-01 9:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 9:53 Shivank Garg
2026-11-26 9:53 ` [PATCH v3 1/3] mm/rmap: factor out migration PTE construction Shivank Garg
2026-12-01 10:56 ` David Hildenbrand (Arm)
2026-11-26 9:53 ` [PATCH v3 2/3] mm/rmap: split try_to_migrate_hugetlb_one() out of try_to_migrate_one() Shivank Garg
2026-12-01 11:03 ` David Hildenbrand (Arm)
2026-11-26 9:53 ` [PATCH v3 3/3] mm/rmap: batch the unmap of large folios in try_to_migrate_one() Shivank Garg
2026-11-30 20:02 ` [PATCH v3 0/3] mm/rmap: batch the unmap of large folios during migration Ravi Jonnalagadda
2026-12-01 9:46 ` Garg, Shivank [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=ce3acf3fe914950ad80fb66e14b3f2864f405cd6.camel@amd.com \
--to=shivankg@amd.com \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=bharata@amd.com \
--cc=byungchul@sk.com \
--cc=david@kernel.org \
--cc=dev.jain@arm.com \
--cc=fvdl@google.com \
--cc=gourry@gourry.net \
--cc=harry@kernel.org \
--cc=jannh@google.com \
--cc=joannelkoong@gmail.com \
--cc=joshua.hahnjy@gmail.com \
--cc=kinseyho@google.com \
--cc=kmanaouil.dev@gmail.com \
--cc=lance.yang@linux.dev \
--cc=liam@infradead.org \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=matthew.brost@intel.com \
--cc=mhocko@suse.com \
--cc=rakie.kim@sk.com \
--cc=ravis.opensrc@gmail.com \
--cc=riel@surriel.com \
--cc=rientjes@google.com \
--cc=rppt@kernel.org \
--cc=surenb@google.com \
--cc=usama.arif@linux.dev \
--cc=vbabka@kernel.org \
--cc=weixugc@google.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®