Skip to content

Releases: tiehexue/zfs

special version for DirectIO on ZVOL and async IO on zfs

23 Jun 14:44

Choose a tag to compare

This branch contains all commits in openzfs#18661 and openzfs#18684 .
There also two issues openzfs#18644 and openzfs#18660 . Refer to the four links for more details.

There are four module parameters added:

  1. zvol_dio_enabled: default 1, enable DirectIO in ZVOL for both linux and freebsd
  2. zfs_vdev_queue_batch (linux only): batched vdev queue, default 0. Because this parameter is read when pool creation/importing, once changed, re-create/re-import the pool again.
  3. zfs_mdcomp_enabled (linux only): default 1, metadata compressing.
  4. zfs_async_dio_enabled (linux only): default 1, enable true async IO.

By testing locally within vm with loop devices, 1, 2, 4 has performance gain, 3 looks not effective, but it should decrease CPU usage.

Testing with real hardware is more than welcome! Better to do following:

#echo 1 | sudo tee /sys/module/zfs/parameters/xxxx

# randread
fio --name=test --rw=randread --bs=16k --filename=zvol/zfs --direct=1 --numjobs=1 --iodepth=64 --exitall --group_reporting --ioengine=libaio --runtime=60 --time_based

# randwrite with numjobs 1
fio --name=test --rw=randwrite --bs=16k --filename=zvol/zfs --direct=1 --numjobs=1 --iodepth=64 --exitall --group_reporting --ioengine=libaio --runtime=60 --time_based

# randwrite with numjobs 8 or $(nproc), specially for with zfs_async_dio_enabled / disabled
fio --name=test --rw=randwrite --bs=16k --filename=zvol/zfs --direct=1 --numjobs=8 --iodepth=64 --exitall --group_reporting --ioengine=libaio --runtime=60 --time_based

For zfs, we have three module parameters, with zfs_async_dio_enabled as 1, the other 2 will have 4 combination, we could have 4 randread/randwrite IOPS, bandwith results, that is 16 numbers.