Buy Low, Sell High: Trend-Aware Memory Compaction for DRAM Energy Efficiency

image

Context

Paging was long believed to have eliminated external fragmentation in physical memory management. In particular, this assumption has led page-frame allocators to largely ignore fragmentation, scattering allocated pages across the physical address space. However, as technology has evolved, physical memory fragmentation has resurfaced as a significant concern — in particular, for DRAM energy efficiency. DRAM is organized into coarse-granular power-management domains that can enter low-power states only when their contents are no longer needed. If allocated pages are dispersed across many domains, even sparsely used regions must remain active, increasing energy consumption. Consolidating allocations into fewer regions can instead allow the remaining DRAM domains to be powered down.

To address this issue, we developed a memory-compaction mechanism optimized for coarse-grained DRAM power management. The mechanism partitions the physical address space into slices, each representing a region that can be independently offlined. It periodically relocates memory contents to concentrate allocations in as few slices as possible. Each slice receives a score estimating the effort required to evacuate it; by prioritizing slices with the lowest scores, the mechanism efficiently reduces fragmentation within the physical memory.

Problem

While the slice score helps determine which slices should be compacted, energy-efficient operation also requires deciding when to compact and how much to compact. Compaction itself consumes CPU time and energy, so its cost must be outweighed by the energy savings achieved through offlining memory slices.

The current approach performs compaction at fixed intervals and within a fixed score budget. This strategy does not account for overall memory-consumption trends and may therefore compact unnecessarily during short-lived periods of low memory demand. Conversely, it may react too slowly when memory pressure significantly decreases for an extended period, missing opportunities to offline DRAM regions. Moreover, once the memory consumption increases, the slices have to be onlined. Also here, the mechanism is faced with a choice between onlining immediately or reclaiming memory first, and how aggressively to reclaim memory.

Goal

The goal of this thesis is to develop and evaluate heuristics for deciding when to offline and online memory slices. The central component will be a memory watcher that monitors memory consumption, identifies relevant workload trends, and uses the kernel API to control memory isolation and movement.

This problem is comparable to stock-market analysis: decisions must be made from a noisy time series, while reacting to every short-term fluctuation would cause potentially harmful actions. Potentially relevant techniques include moving averages (SMA/EMA), moving-average crossovers, volatility measures (rolling standard deviations), a momentum indicator (MACD) to distinguish between fluctuations, short-term trends, and stable long-term trends.

These methods should provide lightweight indicators for distinguishing persistent changes in memory usage from transient variation. For example, compaction and offlining could be initiated only if a smoothed memory-usage signal remains below a threshold for a sustained period and volatility is sufficiently low. Conversely, rising demand or high volatility may justify retaining slices online or onlining additional slices proactively.

The resulting heuristics should balance expected DRAM energy savings against compaction overhead, allocation latency, and the risk of excessive memory pressure. Their effectiveness is to be evaluated with respect to energy consumption, active memory slices, and robustness under changing workloads.

References

Enhancing Energy Efficiency with Advanced DRAM Management in Linux

Modern computer systems face a significant challenge in managing physical memory efficiently, especially in the context of energy consumption. Specifically, the DRAM (Dynamic Random-Access Memory) components in these systems consume a considerable amount of energy due to their constant refresh requirements. [PDF]

 
Typ
Masterarbeit

 
Status
abgeschlossen

 
Supervisors
Alexander Halbuer
Christian Dietrich
Daniel Lohmann

 
Projects
ParPerOS
DRAMaOS

 
Bearbeiter
Illia Ostapyshyn (abgegeben: 01. Nov 2024)

Leveraging Highly-Volatile Pages to Improve Memory Compaction Efficiency in Linux

Studies report that the majority of allocated pages become free within a timespan of seconds. Can a lazy compaction algorithm use this fact to achieve compact memory arrangement with less effort?

 
Typ
Bachelor-/Masterarbeit

 
Status
abgeschlossen

 
Supervisors
Illia Ostapyshyn
Daniel Lohmann

 
Project
DRAMaOS