linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [LSF/MM/BPF TOPIC] Enhancements to Page Migration with Multi-threading and Batch Offloading to DMA
@ 2025-01-23  5:55 Shivank Garg
  2025-01-27  6:55 ` David Rientjes
  2025-03-24  6:01 ` Shivank Garg
  0 siblings, 2 replies; 8+ messages in thread
From: Shivank Garg @ 2025-01-23  5:55 UTC (permalink / raw)
  To: akpm, lsf-pc, linux-mm, ziy
  Cc: AneeshKumar.KizhakeVeetil, baolin.wang, bharata, david,
	gregory.price, honggyu.kim, jane.chu, jhubbard, jon.grimm,
	k.shutemov, leesuyeon0506, leillc, liam.howlett, linux-kernel,
	mel.gorman, Michael.Day, Raghavendra.KodsaraThimmappa, riel,
	rientjes, santosh.shukla, shivankg, shy828301, sj,
	wangkefeng.wang, weixugc, willy, ying.huang

Hi all,

Zi Yan and I would like to propose the topic: Enhancements to Page
Migration with Multi-threading and Batch Offloading to DMA.

Page migration is a critical operation in NUMA systems that can incur
significant overheads, affecting memory management performance across
various workloads. For example, copying folios between DRAM NUMA nodes
can take ~25% of the total migration cost for migrating 256MB of data.

Modern systems are equipped with powerful DMA engines for bulk data
copying, GPUs, and high CPU core counts. Leveraging these hardware
capabilities becomes essential for systems where frequent page promotion
and demotion occur - from large-scale tiered-memory systems with CXL nodes
to CPU-GPU coherent system with GPU memory exposed as NUMA nodes.

Existing page migration performs sequential page copying, underutilizing
modern CPU architectures and high-bandwidth memory subsystems.

We have proposed and posted RFCs to enhance page migration through three
key techniques:
1. Batching migration operations for bulk copying data [1]
2. Multi-threaded folio copying [2]
3. DMA offloading to hardware accelerators [1]

By employing batching and multi-threaded folio copying, we are able to
achieve significant improvements in page migration throughput for large
pages.

Discussion points:
1. Performance:
   a. Policy decision for DMA and CPU selection
   b. Platform-specific scheduling of folio-copy worker threads for better
      bandwidth utilization
   c. Using Non-temporal instructions for CPU-based memcpy
   d. Upscaling/downscaling worker threads based on migration size, CPU
      availability (system load), bandwidth saturation, etc.
2. Interface requirements with DMA hardware:
   a. Standardizing APIs for DMA drivers and support for different DMA
      drivers
   b. Enhancing DMA drivers for bulk copying (e.g., SDXi Engine)
3. Resources Accounting:
   a. CPU cgroups accounting and fairness [3]
   b. Who bears migration cost? - (Migration cost attribution)

References:
[1] https://lore.kernel.org/all/20240614221525.19170-1-shivankg@amd.com
[2] https://lore.kernel.org/all/20250103172419.4148674-1-ziy@nvidia.com
[3] https://lore.kernel.org/all/CAHbLzkpoKP0fVZP5b10wdzAMDLWysDy7oH0qaUssiUXj80R6bw@mail.gmail.com

Best Regards,
Shivank


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-03-25  5:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-23  5:55 [LSF/MM/BPF TOPIC] Enhancements to Page Migration with Multi-threading and Batch Offloading to DMA Shivank Garg
2025-01-27  6:55 ` David Rientjes
2025-01-27 12:37   ` Zi Yan
2025-01-27 13:55     ` Jonathan Cameron
2025-01-27 16:30       ` Zi Yan
2025-01-28  6:54     ` Shivank Garg
2025-03-24  6:01 ` Shivank Garg
2025-03-25  5:20   ` Shivank Garg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox