Giter VIP home page Giter VIP logo

josehu07 / splitfs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from utsaslab/splitfs

0.0 1.0 0.0 311.6 MB

SplitFS: persistent-memory file system that reduces software overhead (SOSP 2019)

Home Page: https://www.cs.utexas.edu/~vijay/papers/sosp19-splitfs.pdf

License: Other

Makefile 0.27% C 98.01% C++ 0.03% Shell 0.23% Perl 0.12% Python 0.12% Roff 0.02% M4 0.01% Batchfile 0.01% Assembly 1.16% Awk 0.01% sed 0.01% Yacc 0.01% Lex 0.01% UnrealScript 0.01% SmPL 0.02% Gherkin 0.01% XS 0.01% Clojure 0.01% Raku 0.01%

splitfs's Introduction

SplitFS - Linux v5.4.0

This is a port of SplitFS to Linux kernel v5.4.0 for Ubuntu Focal 20.04.

Contents:

  1. kernel/: source code of Linux kernel v5.4.0, with the relink operation added as dynamic_remap syscall at entry index 335 for x86_64
  2. splitfs/: source code of SplitFS
  3. tests/: PJD Posix FS test suite
  4. micro/: a simple toy microbenchmark

Dependencies

Required packages for kernel build and splitfs:

sudo apt update
sudo apt install libelf-dev libncurses5-dev bc libboost-dev

Build & Install Kernel

Build and install kernel deb packages (when menuconfig pops up, tweak any options as desired, or simply save & exit):

cd kernel
./compile_kernel.sh <num_threads>
sudo dpkg -i linux-*.deb

Check installed kernel's GRUB menu entry:

awk -F\' '$1=="menuentry " || $1=="submenu " {print i++ " : " $2}; /\tmenuentry / {print "\t" i-1">"j++ " : " $2};' /boot/grub/grub.cfg

Change GRUB config to boot into installed kernel:

sudo vim /etc/default/grub
    # Say new kernel at 1>4, change to GRUB_DEFAULT="1>4"
    # If emulating pmem device with DRAM, add `memmap=8G!4G nokaslr` to GRUB_CMDLINE_LINUX_DEFAULT
    #   this reserves 8G starting at 4G offset of DRAM as `/dev/pmem0`
sudo update-grub && sudo update-grub2

Reboot and verify that the correct kernel is booted with the desired parameters:

sudo reboot
uname -r            # should see 5.4.0-91-splitfs
cat /proc/cmdline   # check boot parameters
ls /dev             # should see /dev/pmem0

Build SplitFS Library

Build SplitFS dynamic library:

cd splitfs
make clean && make
cd ..

Notice that LEDGER_YCSB environment variable is not set here. SplitFS source code uses macro flags (derived from environment variables) extensively to turn code pieces on/off... I was only able to run the microbenchmark successfully without any LEDGER_* variables on.

Set Up Ext4-DAX

Format pmem0 into ext4 and mount in DAX mode:

sudo mkfs.ext4 -b 4096 /dev/pmem0
sudo mkdir /mnt/pmem_emul
sudo mount -o dax /dev/pmem0 /mnt/pmem_emul
sudo chown -R $USER /mnt/pmem_emul

Run Microbenchmark

Build microbenchmark:

cd micro
make
cd ..

Run with raw ext4-DAX:

sudo sync && sudo bash -c 'echo 3 > /proc/sys/vm/drop_caches'
./micro/rw_expt write seq 4096

In splitfs/nvp_lock.h line 55 the number of per-core locks is hardcoded:

    #define NVP_NUM_LOCKS   32      // == 2 * num of CPU cores

, so processes running over SplitFS must be on CPU core <= 15 if you have a machine with more cores. Core pinning could be done through taskset.

Run with SplitFS:

rm -f /mnt/pmem_emul/append.log /mnt/pmem_emul/DR-* /mnt/pmem_emul/test.txt
export LD_LIBRARY_PATH=$(realpath .)/splitfs
export NVP_TREE_FILE=$(realpath .)/splitfs/bin/nvp_nvp.tree
sudo sync && sudo bash -c 'echo 3 > /proc/sys/vm/drop_caches'
taskset -c 0-7 bash -c 'LD_PRELOAD=$(realpath .)/splitfs/libnvp.so ./micro/rw_expt write seq 4096'

Application: LevelDB

Get LevelDB and compile:

git clone https://github.com/google/leveldb.git
cd leveldb
git submodule update --init --recursive
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . -j

Theoretically, LevelDB tests should run successfully through:

rm -f /mnt/pmem_emul/append.log /mnt/pmem_emul/DR-*
mkdir -p /mnt/pmem_emul/leveldbdir
export LD_LIBRARY_PATH=$(realpath .)/splitfs
export NVP_TREE_FILE=$(realpath .)/splitfs/bin/nvp_nvp.tree
taskset -c 0-7 bash -c 'LD_PRELOAD=$(realpath .)/splitfs/libnvp.so TEST_TMPDIR=/mnt/pmem_emul/leveldbdir ./leveldb/build/leveldb_tests'

However, on my side, SplitFS hangs in tests such as SparseMerge. I was not able to debug it because the source code looks like quite a mess.

splitfs's People

Contributors

rohankadekodi avatar vijay03 avatar omsaran avatar josehu07 avatar om-saran avatar dependabot[bot] avatar chenhao-ye avatar krishnangosakan avatar saurabhkadekodi avatar wraymo avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.