目录

CXL-RPC

基于 CXL 共享内存的高性能 RPC 系统原型(2026 开放原子开源大赛参赛作品)。

项目状态

  • 项目目录结构创建
  • Git 仓库初始化
  • 共享内存环形队列实现
  • 基础 RPC 调用流程
  • CXL 环境适配
  • 复杂数据结构支持

核心设计

  • 零序列化:通过在共享内存中直接传递数据指针,绕过序列化/反序列化开销
  • 请求/完成队列:基于无锁环形队列的通信机制
  • 多路径支持:CXL 主路径 + RDMA/TCP 降级路径
  • 安全隔离:参考 RPCool,使用内存保护键实现沙箱

项目架构

┌─────────────────────────────────────────────────────────┐
│                      应用层                              │
│            (KV Store / Calculator / 用户代码)            │
├─────────────────────────────────────────────────────────┤
│                    RPC 接口层                            │
│              (cxl_rpc.h: init/call/register)            │
├─────────────────────────────────────────────────────────┤
│                     核心运行时                           │
│  ┌─────────────┐ ┌─────────────┐ ┌─────────────┐        │
│  │  请求队列    │ │  完成队列    │ │  共享内存池  │        │
│  │ (环形缓冲区) │ │ (环形缓冲区) │ │   (malloc)  │        │
│  └─────────────┘ └─────────────┘ └─────────────┘        │
├─────────────────────────────────────────────────────────┤
│                      传输层                              │
│  ┌─────────────┐ ┌─────────────┐ ┌─────────────┐        │
│  │  CXL 路径   │ │ RDMA 降级   │ │ TCP 兜底    │        │
│  └─────────────┘ └─────────────┘ └─────────────┘        │
├─────────────────────────────────────────────────────────┤
│                   底层基础设施                           │
│         (QEMU + CXLMemSim / 真实 CXL 硬件)              │
└─────────────────────────────────────────────────────────┘

环境要求

  • openEuler 24.03 LTS(或其他 Linux 发行版)
  • GCC 11+ / Clang 15+
  • CMake 3.15+
  • QEMU 8.0+(带 CXL 模拟支持)

快速开始

# 克隆仓库
git clone git@github.com:LiuHongsGitHub/cxl-rpc.git
cd cxl-rpc

# 编译(待实现)
mkdir build && cd build
cmake ..
make

# 运行示例(待实现)
./bin/cxl_rpc_server &
./bin/cxl_rpc_client

参考论文

  1. HydraRPC: RPC in the CXL Era (USENIX ATC 2024)
    核心思想:利用 CXL HDM 传输数据,绕过 CPU 缓存,使用 MONITOR/MWAIT 高效通知。

  2. Telepathic Datacenters: Fast RPCs using Shared CXL Memory (arXiv 2024)
    核心思想:传递指针避免序列化,通过内存权限管理恢复安全性,支持 RDMA 降级。

  3. zBuffer: Zero-Copy and Metadata-Free Serialization (PPoPP 2026)
    核心思想:零拷贝、无元数据序列化,利用 Scatter-Gather 反射机制。

  4. Cxlalloc: Safe and Efficient Memory Allocation for a CXL Pod (ASPLOS 2026)
    核心思想:为 CXL Pod 设计的安全高效内存分配器。

@inproceedings{HydraRPC2024,
  author    = {Teng Ma and Zheng Liu and Chengkun Wei and Jialiang Huang and
               Youwei Zhuo and Haoyu Li and Ning Zhang and Yijin Guan and
               Dimin Niu and Mingxing Zhang and Tao Ma},
  title     = {HydraRPC: {RPC} in the {CXL} Era},
  booktitle = {2024 USENIX Annual Technical Conference (USENIX ATC '24)},
  pages     = {387--395},
  year      = {2024}
}

@misc{RPCool2024,
  title         = {Telepathic Datacenters: Fast RPCs using Shared CXL Memory},
  author        = {Suyash Mahar and Ehsan Hajyjasini and Seungjin Lee and 
                   Zifeng Zhang and Mingyao Shen and Steven Swanson},
  year          = {2024},
  eprint        = {2408.11325},
  archiveprefix = {arXiv},
  primaryclass  = {cs.DC}
}

@inproceedings{zBuffer2026,
  author    = {Xiangyu Liu and Huiba Li and Shun Gai and Youmin Chen and Yiming Zhang},
  title     = {zBuffer: Zero-Copy and Metadata-Free Serialization for Fast {RPC} with Scatter-Gather Reflection},
  booktitle = {Proceedings of the 31st ACM SIGPLAN Annual Symposium on Principles and 
               Practice of Parallel Programming (PPoPP '26)},
  publisher = {ACM},
  year      = {2026}
}

@inproceedings{Cxlalloc2026,
  author    = {Newton Ni and Yan Sun and Zhiting Zhu and Emmett Witchel},
  title     = {Cxlalloc: Safe and Efficient Memory Allocation for a {CXL} Pod},
  booktitle = {Proceedings of the 31st ACM International Conference on Architectural 
               Support for Programming Languages and Operating Systems, Volume 2 (ASPLOS '26)},
  pages     = {528--545},
  publisher = {ACM},
  year      = {2026}
}
关于
232.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号