ccNVMe is an extension of NVMe (Non-Volatile Memory Express) that provides atomicity and ordering guarantees at the device driver while reducing the traffic over the PCIe bus. This repository contains the source code of ccNVMe and instructions for reproducing the results in the ccNVMe paper, to appear in SOSP'21.
ccnvme/
: ccNVMe kernel modulemqfs/
: the MQFS file system kernel modulenvme-host/
: NVMe over PCIe kernel moduleccnvme-test/
: tests for ccNVMepatch/
: Linux kernel patch for MQFS, and CrashMonkey patch for testing MQFS atop ccNVMeae-scripts/
: instructions for reproducing the results of the paper (AE)
- Operating system: Linux kernel 4.18.20
- Storage: at least one NVMe SSD that enables the PMR (persistent memory region) feature. Other alternatives of the PMR: use persistent memory or DRAM to store the submission queues; complies ccNVMe with
-DUSE_AEP
flag; WARNING: this emulation is not well tested.
This section introduces the instructions to compile and install of the kernel, ccNVMe and MQFS. Artifact evaluation committees can go to the ae-scripts/
directory and login into the server, as we have provided the environment that contains all prerequisites.
- Download the vanilla Linux kernel 4.18.20.
wget https://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/linux-4.18.20.tar.gz tar xzvf linux-4.18.20.tar.gz
- Apply the kernel patch.
cd linux-4.18.20 git clone https://github.com/thustorage/ccnvme.git git apply patch/mqfs.patch
- Make and install the new kernel.
cp /boot/config-`uname -r` .config make olddefconfig make -j24 make modules_install -j24 make install
- Update the grub configuration in
/etc/default/grub
to enable default login of the new kernel as well as to disableuse_cmb_sqes
. For example:GRUB_DEFAULT="1>Ubuntu, with Linux 4.18.20" GRUB_CMDLINE_LINUX="nvme.use_cmb_sqes=0"
- Reboot into the new kernel.
update-grub && reboot
- Build and install NVMe.
cd nvme-host make -j24 ./reset_nvme.sh
- Build and install ccNVMe.
cd ccnvme make -j24 insmod ccnvme.ko cp_device=/dev/nvme0n1p1 nr_streams=24
NOTE:
cp_device
specifies the file system journal device. Recommended to use a device partition whose size is larger than 1.01 GB (by default 1 GB journal size and 10 MB for PMR checkpoint). Theoretically, ccNVMe does not require an extra device. It is just an implementation issue here, as we originally tightly couple the journaling with ccNVMe. If applications or upper systems want to directly use ccNVMe and implement their own journaling mechanism,cp_device
can be set to an arbitrary device (e.g., ramdisk /dev/ram0); no data will be stored on thatcp_device
in this case.nr_streams
specifies the number of hardware queues. Recommended to set it to a number that equals to the number of physical cores.journal_size
specifies the size of journal region of the MQFS. By default 1 GB. - Build, install and mount MQFS.
cd mqfs make -j24 insmod mqfs.ko mkfs.ext4 -O ^has_journal /dev/nvme0n1p2 mount -t mqfs /dev/nvme0n1p2 -o nr_streams=24 /dev/nvme0n1p2
NOTE:
/dev/nvme0n1p2
specifies the data device.nr_streams
specifies the number of hardware queues, recommended to be equal to that of ccNVMe.
Now, an MQFS is mounted at /mnt/test, storing the journal to /dev/nvme0n1p1
and the data to /dev/nvme0n1p2
.