We provide the source code and setup necessary for
This operation avoids copying data at the time of function call. Instead, if copied destinations are later accessed,
For full details on the different mechanisms we evaluate, please refer to our paper:
(MC)^2: Lazy MemCopy at the Memory Controller Aditya K Kamath, Simon Peter ACM/IEEE 51st Annual International Symposium on Computer Architecture (ISCA), 2024
This repository consists of the source code of the simulator and all scripts needed to replicate the figures in the paper. We shall first explain how to replicate our results, then highlight the important files and folders contained in this repository.
Our repository builds on the gem5 simulator (original readme for gem5 is retained as README). Detailed instructions on building gem5 and alternative docker containers can be found on their webpage.
Ensure that your machine supports KVM, as this is used during our simulations. This can be done by running the following command and ensuring the return value is 1 or more:
egrep -c '(vmx|svm)' /proc/cpuinfo
Ubuntu 20.04 or 22.04 is preferred. The following commands installs all the dependencies for Ubuntu 22.04:
sudo apt install build-essential git m4 scons zlib1g zlib1g-dev \
libprotobuf-dev python3-dev protobuf-compiler libprotoc-dev \
qemu-kvm libvirt-daemon-system libgoogle-perftools-dev \
libboost-all-dev pkg-config python3-tk libvirt-clients \
bridge-utils python3-matplotlib python3-numpy
To generate the gem5 executable, you can run the following command, replacing {cpus} with the number of threads to use to build. When running experiments, this command is automatically executed by the Makefile.
scons build/X86/gem5.opt -j {cpus}
The disk images used for our evaluation can be downloaded from here: https://zenodo.org/records/11479488
Unzip this file, and place the os folder inside the mcsquare folder in this repository.
This folder structure should look like: MCSquare-ISCA24/mcsquare/os/
Once the setup for gem5 is completed, proceed with the following steps to run the artifact. Individual experiments can be run and figures obtained by running the following commands:
make launch_micro_latency #Figure 10: 10 min
make launch_micro_breakdown #Figure 11: 10 min
make launch_micro_seq #Figure 12: 30 min
make launch_micro_rand #Figure 13: 1 hr
make launch_protobuf #Figure 14,20: 2 hr
make launch_mongo #Figure 15: 15 hr
make launch_mvcc #Figure 16,17: 6 hr
make launch_hugepage_access #Figure 18 20 min
make launch_pipe #Figure 19: 15 min
make launch_src_write #Figure 21: 10 min
The outputs will be generated as two seperate files. A TXT file is generated in results/figure_X.txt, where X is the specific figure number, which contains the raw numbers to be plotted. figures/figure_X.png will contain the plotted figure. The exception is for Figure 20, where only a TXT file containing the table is generated. Minor variances in performance numbers occur from run to run, but general trends should remain stable.
Alternatively, to run all the benchmarks and generate figures run:
make launch_all
To regenerate all outputs run:
make extract_all
A new folder called mcsquare contains the files that implement
-
mcsquare/lib: This folder contains the runtime code for
$(MC)^{2}$ , consisting of a header file (mcsquare.h) containing the function for lazy memcpy (memcpy_elide_clwb), and the library interposers. These files are used within simulation to convert benchmarks from standard memcpy to lazy memcpy. - mcsquare/scripts: This folder contains bash and python scripts for executing experiments and plotting the different graphs.
- mcsquare/results: This folder is generated on running an experiment, and contains the raw output for the experiment.
- mcsquare/figures: This folder is generated on completing an experiment, and contains the plotted figure for the experiment.
The functionality for
- Modified linux contains the source code of Linux modified to use lazy copies on huge page faults and when writing to/reading from pipes.
- Modified Cicada contains the source code of the Cicada MVCC database modified to allow varying row sizes and granularities of writes.
- Modified zIO contains the source code of zIO modified to copy elide all memcpy operations instead of just IO-based ones.