Test workloads for ZNS
Clone repo:
git clone https://github.com/johnramsden/ZNWorkload.git --recursive
Compile dependencies:
./build-deps.sh
Compile project:
meson setup buildDir
meson compile -C buildDir
There are various variables that can be set: (defaults in meson_options.txt
)
debugging
: Enables debug output (default true)debugsymbols
: Enables debug symbolsverify
: Enables correctness verification (default true)BLOCK_ZONE_CAPACITY
: Sets SSD zone size (default 1077MiB 1129316352)READ_SLEEP_US
: Read delay to simulate remote data (default 40430us)PROFILING_INTERVAL_SEC
: Interval to print metrics on (averaged) (default 10)PROFILER_PRINT_EVERY
: Print metrics on every call, not just at interval (default true)EVICT_HIGH_THRESH_ZONES
: High water mark for zone evictionEVICT_LOW_THRESH_ZONES
: Low water mark for zone evictionEVICT_HIGH_THRESH_CHUNKS
: High water mark for chunk evictionEVICT_LOW_THRESH_CHUNKS
: Low water mark for chunk evictionEVICT_INTERVAL_US
: Sleep time between evictions (us) (default 100,000, or 0.1s)EVICTION_POLICY
: (ZN_EVICT_PROMOTE_ZONE
,ZN_EVICT_CHUNK
) Eviction policy, defaultZN_EVICT_PROMOTE_ZONE
MAX_ZONES_USED
: Set maximum zones to use (default 0 means all)
To modify these:
meson setup --reconfigure buildDir -Dverify=true -Ddebugging=true -DBLOCK_ZONE_CAPACITY=1048576
meson compile -C buildDir
IMPORTANT: Must use a non re-ordering scheduler such as mq-deadline
, set accordingly in /sys/block/$DEVICE/queue/scheduler
echo mq-deadline | tee /sys/block/$DEVICE/queue/scheduler
cat /sys/block/$DEVICE/queue/scheduler
Create an emulated ZNS device via scripts/nullblk-zones.sh
with:
- sector size: 4096B
- zone size: 32MiB
- conventional zones (non seq writes): 0
- sequential zones: 100
./scripts/nullblk.sh 4096 32 0 100 "zns" # or ssd
Created /dev/nullb0
To destroy:
./scripts/nullblk-zoned-delete.sh 0 # Replace 0 with ID if different
For detailed experiment reproduction, see WORKLOADS
For mini-test:
- 14 zones
- 8chunks per zone
2*14=28 is capacity
- Start evict at 2 zones free:
24
entries - On evict, evict 4 zones:
20
entries remain
ZNS:
./scripts/nullblk.sh 4096 1 0 14 "zns"
On SSD:
./scripts/nullblk.sh 4096 1 0 14 "ssd"
./zncache /dev/nullb0 524288 2
This means 2chunks to fill a zone: 1024*1024/2
Run doxygen
:
doxygen Doxyfile
Open docs/html/index.html
in a browser.
Run clang-format
:
clang-format -i src/ze_cache.c