The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Ravi Jonnalagadda <ravis.opensrc@gmail.com>
To: Shivank Garg <shivankg@amd.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	David Hildenbrand <david@kernel.org>,
	Lorenzo Stoakes <ljs@kernel.org>, Rik van Riel <riel@surriel.com>,
	"Liam R. Howlett" <liam@infradead.org>,
	Vlastimil Babka <vbabka@kernel.org>, Harry Yoo <harry@kernel.org>,
	Jann Horn <jannh@google.com>, Lance Yang <lance.yang@linux.dev>,
	Mike Rapoport <rppt@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>, Zi Yan <ziy@nvidia.com>,
	Matthew Brost <matthew.brost@intel.com>,
	Joshua Hahn <joshua.hahnjy@gmail.com>,
	Rakie Kim <rakie.kim@sk.com>, Byungchul Park <byungchul@sk.com>,
	Gregory Price <gourry@gourry.net>,
	Ying Huang <ying.huang@linux.alibaba.com>,
	Alistair Popple <apopple@nvidia.com>,
	Joanne Koong <joannelkoong@gmail.com>,
	Karim Manaouil <kmanaouil.dev@gmail.com>,
	Frank van der Linden <fvdl@google.com>,
	Kinsey Ho <kinseyho@google.com>, Wei Xu <weixugc@google.com>,
	Bharata B Rao <bharata@amd.com>,
	David Rientjes <rientjes@google.com>, Dev Jain <dev.jain@arm.com>,
	Usama Arif <usama.arif@linux.dev>,
	Miaohe Lin <linmiaohe@huawei.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 0/3] mm/rmap: batch the unmap of large folios during migration
Date: Mon, 30 Nov 2026 12:02:27 -0800	[thread overview]
Message-ID: <20261130200227.82773-1-ravis.opensrc@gmail.com> (raw)
In-Reply-To: <20261126-migrate-rmap-batch-v3-0-4112998fb472@amd.com>

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>

Thanks,
Ravi

[1] https://lore.kernel.org/linux-mm/20261123053543.295467-1-dev.jain@arm.com/
[2] https://lore.kernel.org/all/20261128224616.66122-1-ravis.opensrc@gmail.com/
[3] https://lore.kernel.org/all/20261128225943.66318-1-ravis.opensrc@gmail.com/

      parent reply	other threads:[~2026-11-30 20:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26  9:53 [PATCH v3 0/3] mm/rmap: batch the unmap of large folios during migration Shivank Garg
2026-11-26  9:53 ` [PATCH v3 1/3] mm/rmap: factor out migration PTE construction Shivank Garg
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-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 ` Ravi Jonnalagadda [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=20261130200227.82773-1-ravis.opensrc@gmail.com \
    --to=ravis.opensrc@gmail.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=riel@surriel.com \
    --cc=rientjes@google.com \
    --cc=rppt@kernel.org \
    --cc=shivankg@amd.com \
    --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