OpenMPDK / SMDK

SMDK, Scalable Memory Development Kit, is developed for Samsung CXL(Compute Express Link) Memory Expander to enable full-stack Software-Defined Memory system
271 stars 60 forks source link

About the migration API and eBPF CXLSwap #20

Closed victoryang00 closed 1 year ago

victoryang00 commented 1 year ago

I'd like to know how SMDK provides a migration interface for userspace memory. And does SMDK have a kernel integration roadmap for CXLSwap, like using eBPF to inspect the dynamic usage of page cache and issue the CXLSwap?

SeungjunHa commented 1 year ago

Hi, victoryang00. I'm Seungjun Ha, member of SMDK Team.

To answer your question more correctly, let me sure two things first

First, CXL Swap is Kernel Build-In Module and Frontswap Interface like zSwap. You can set some parameters for CXL Swap using userspace interface like ./cxl enable-cxlswap or ./cxl check-cxlswap. (cxl-swap-commands) Also you can set parameters by yourself using /sys/module/cxlswap/parameters directly, because CXL Swap is Kernel Module.

Second, CXL Swap is for anonymous page not page cache. As we described our wiki page, kernel has two types of page "FilePage(= PageCache)" and "AnonPage". Because CXL Swap is frontswap interface, it handles the reclaimed AnonPage.

Please find answers below on your two questions

Q1. how SMDK provides a migration interface userspace memory A1. Currently, SMDK provides a set of userspace API to explicitly acces DDR or CXL memory, which we call it Optmization API. Also, we will expand intelligent tiering engine that include the entier tiering operation of DDR/CXL at userspace. In addition, CXL Swap working in kernelspace includes DDR/CXL migration when PFRA happens due to DRAM pressure. We will further support CXL Cache in kernelspace from SMDK v1.4 release.

Q2. Is there Kernel integration plan for CXL Swap like using eBPF to inspect the dynamic usage of page cache and issue the CXSwap A2. CXL Swap is a built-in kernel modules, so I think eBPF can be used using existing tracepoint like kprobe, uprobe, etc. Please tell me if i'm wrong. In addition, CXL Swap is planning to expand some functionalities to support memory pool better.

victoryang00 commented 1 year ago

Thank you!