A DMA-based Swap Mechanism of Hybrid Memory System

Weijie Zhang, Lidang Xu, Dingding Li, Haoyu Luo · 2022

Typical applications of smart cities, such as smart public services, require a large memory footprint to store user data and facilitate the responsive results of user queries, thus inevitably activating the memory swap mechanism between memory and storage to expand the capacity of main memory. Frequent page swapping can cause performance interference for hard real-time operating systems such as SylixOS. In a hybrid memory architecture, namely the novel persistent memory (PM) alongside the conventional DRAM, the swap mechanism often uses the PM to act as the swap partition and executes memory copying to transfer the data between DRAM and PM, resulting in frequent I/O operations and high CPU consumption. Eventually, the memory performance is sub-optimal. By leveraging a general DMA technology of memory-to-memory (M2M), namely Intel I/OAT, we propose PM-Swap, a swap mechanism without heavy CPU consumption. PM-Swap further contains three techniques: (1) a new memory reclamation algorithm based on instruction sampling and page awareness, which reduces the unnecessary swap operations; (2) according to the data size, a switching strat-egy selects the suitable swapping path between the original CPU and the DMA, to maintain reasonable memory performance; (3) bulk transferring is employed for improving the overall throughput of the page swapping. We implement PM-Swap in a stable Linux kernel (5.17.9). The experimental results show that PM-Swap can decrease CPU overhead by more than 39% and increase page swapping bandwidth by up to$1.76\times$.

Read the paper · More papers on PaperTik