With the advent of byte-addressable memory devices, such as CXL memory, persistent memory, and storage-class memory, tiered memory systems have become a reality. Page migration is the de facto method within operating systems for managing tiered memory. It aims to bring hot data whenever possible into fast memory to optimize the performance of data accesses while using slow memory to accommodate data spilled from fast memory. While the existing research has demonstrated the effectiveness of various optimizations on page migration, it falls short of addressing a fundamental question: Is exclusive memory tiering, in which a page is either present in fast memory or slow memory, but not both simultaneously, the optimal strategy for tiered memory management? We demonstrate that page migration-based exclusive memory tiering suffers significant performance degradation when fast memory is under pressure. In this paper, we propose non-exclusive memory tiering, a page management strategy that retains a copy of pages recently promoted from slow memory to fast memory to mitigate memory thrashing. To enable non-exclusive memory tiering, we develop MATRYOSHKA, a new mechanism that features transactional page migration and page shadowing. MATRYOSHKA removes page migration off the program's critical path and makes migration asynchronous. Evaluations with microbenchmarks and realworld applications show that MATRYOSHKA achieves 6x performance improvement over the state-of-the-art transparent page placement (TPP) approach under memory pressure. We also compare MATRYOSHKA with a recently proposed sampling-based migration approach and demonstrate MATRYOSHKA's strengths and potential weaknesses in various scenarios. Through the evaluations, we discover a serious issue facing all tested approaches, unfortunately including MATRYOSHKA, and call for further research on tiered memory-aware memory allocation.
翻译:随着CXL内存、持久化内存和存储级内存等字节可寻址内存设备的出现,分层内存系统已成为现实。页面迁移是操作系统管理分层内存的事实标准方法,其目标是在可能时将热数据迁移至快速内存以优化数据访问性能,同时利用慢速内存容纳快速内存溢出的数据。现有研究已证实页面迁移各类优化方法的效果,但未能解决一个根本性问题:在独占性内存分层策略(即一个页面仅存在于快速内存或慢速内存中,而非同时存在于两者)中,这是否是分层内存管理的最优策略?我们证明,当快速内存面临压力时,基于页面迁移的独占性内存分层会出现显著的性能退化。本文提出非独占性内存分层——一种保留近期从慢速内存提升至快速内存的页面副本以缓解内存抖动问题的页面管理策略。为实现非独占性内存分层,我们开发了MATRYOSHKA这一新机制,该机制具有事务化页面迁移与页面影子副本功能。MATRYOSHKA将页面迁移移出程序关键路径,实现异步迁移。微基准测试与实际应用的评估表明,在内存压力下,MATRYOSHKA相较于当前最先进的透明页面放置方法性能提升达6倍。我们还将MATRYOSHKA与近期提出的基于采样的迁移方法进行对比,展示了其在不同场景下的优势与潜在不足。通过评估,我们发现所有测试方法(包括MATRYOSHKA)均面临一个严峻问题,并呼吁针对分层内存感知的内存分配展开进一步研究。