vCAT: Dynamic Cache Management Using CAT Virtualization

Meng Xu, Linh Thi Xuan Phan, Hyon-Young Choi, Insup LeeRTAS 2017

TL;DR

This paper introduces vCAT, a novel system for dynamic cache management in virtualized real-time systems. By leveraging Intel's Cache Allocation Technology (CAT), vCAT provides strong cache isolation at both VM and task levels, significantly improving worst-case execution times and overall system utilization, especially in dynamic environments.

What Problem Does This Paper Address?

Modern real-time systems are becoming increasingly complex, often running on shared virtualization platforms like Xen. A critical challenge in these environments is shared cache interference. When multiple tasks or VMs concurrently access the last-level cache (LLC), they can evict each other's data, leading to cache misses and unpredictable delays. This interference can drastically increase the worst-case execution time (WCET) of tasks, potentially causing deadline misses, which is unacceptable for real-time systems. While static cache partitioning exists, it often leads to underutilization and doesn't adapt to dynamic workloads. Existing solutions either lack strong isolation guarantees or are restricted to static configurations, failing to meet the demands of modern, dynamic real-time systems.

Methods

The core of vCAT is its cache partition virtualization layer built on top of Intel's Cache Allocation Technology (CAT). CAT is a hardware feature that allows partitioning the LLC at the core level. vCAT extends this by:

  • Virtualizing CAT: It creates a virtual layer for cache partitions, analogous to virtual memory. This allows the hypervisor to expose "virtual partitions" to VMs, which are then transparently mapped to physical CAT partitions.
  • Hypervisor-level Allocation: The hypervisor can allocate these virtual partitions to VMs using various policies (e.g., strict isolation, oversubscription, sharing). It manages the mapping between virtual and physical partitions and enforces contiguity requirements of CAT.
  • Guest-level Allocation: Within each VM, the guest kernel can dynamically allocate its virtual partitions to individual tasks. This allows for fine-grained control and adaptation to task demands.
  • Dynamic Management: Unlike previous static approaches, vCAT supports dynamic re-allocation of cache partitions at runtime. This is crucial for systems with varying task demands or multi-mode operations.
  • Cache Flushing: To ensure strong isolation, vCAT implements cache flushing mechanisms. When partitions are re-assigned, the system can flush the old contents to prevent interference. They explore heuristics for choosing between clflush and wbinvd instructions for efficiency.

Datasets

The paper evaluates vCAT using:

  • PARSEC benchmarks: A suite of parallel applications used for WCET-related evaluations and schedulability analysis.
  • Synthetic workloads: Specifically, cache-bench and cache-bomb programs designed to stress cache behavior and evaluate interference. These are used to measure WCET and schedulability under various cache allocation scenarios.

Key Insights and Ideas

  • CAT is powerful but needs virtualization: Intel's CAT provides hardware-level cache partitioning, but it's primarily designed for VM-level allocation. vCAT bridges the gap by virtualizing CAT to enable fine-grained, dynamic task-level cache management within VMs.
  • Dynamic allocation is key for modern systems: Static cache partitioning, while simple, leads to significant underutilization. vCAT's dynamic allocation significantly outperforms static methods, especially for workloads with varying timing requirements.
  • Cache lookup control is a challenge: A critical finding is that CAT itself doesn't control cache lookups (hits). If a partition is re-assigned, cached data from the previous owner might still be accessible, necessitating explicit flushing mechanisms for true isolation.
  • Minimal overhead for significant gains: The vCAT prototype introduces only minimal overhead for partition context switches and allocations, making it practical for real-time systems.
  • Strong isolation protects WCET: By effectively isolating tasks, vCAT can drastically reduce the WCET increase caused by cache interference, sometimes by over 7x.

Key Results

  • WCET Reduction: vCAT can reduce task WCET increases caused by shared cache interference by up to 7.2x.
  • System Utilization Improvement: Static cache management in vCAT can increase system utilization by up to 7x compared to a system without cache management.
  • Dynamic vs. Static Performance: Dynamic management substantially outperforms static management, improving schedulable utilization by up to 3x in a multi-mode example use case.
  • Minimal Overhead: Partition context switch overhead is very small (upper bounded by 0.25µs), and allocation/deallocation overheads are negligible (upper bounded by 550ns). Flushing overhead is at most 0.7ms.

Limitations and Future Work

  • Contiguous Partition Requirement: Current CAT hardware requires contiguous partitions, leading to potential fragmentation. vCAT handles this through defragmentation, but this can incur performance costs. Future hardware might alleviate this.
  • Manual Configuration: Currently, hypervisor-level partition-to-VM mappings and shared flags require manual configuration.
  • Future Work: The authors suggest applying vCAT to other settings, developing new compositional analysis techniques for cache-aware schedulability, and exploring VM interfaces for computation. They also mention that determining the optimal number of partitions to reserve for each VM is an open research question.

Summary updated

BibTeX
@inproceedings{xu2017vcat,
  author = {Meng Xu and Linh Thi Xuan Phan and Xuan Phan and Hyon-Young Choi and Insup Lee},
  title = {{vCAT: Dynamic Cache Management Using CAT Virtualization}},
  booktitle = {RTAS},
  year = {2017},
  doi = {10.1109/rtas.2017.15},
}
Figure