• S
    btrfs: enable nowait async buffered writes · 926078b2
    Stefan Roesch 提交于
    Enable nowait async buffered writes in btrfs_do_write_iter() and
    btrfs_file_open().
    
    In this version encoded buffered writes have the optimization not
    enabled. Encoded writes are enabled by using an ioctl. io_uring
    currently does not support ioctls. This might be enabled in the future.
    
    Performance results:
    
      For fio the following results have been obtained with a queue depth of
      1 and 4k block size (runtime 600 secs):
    
                     sequential writes:
                     without patch           with patch      libaio     psync
      iops:              55k                    134k          117K       148K
      bw:               221MB/s                 538MB/s       469MB/s    592MB/s
      clat:           15286ns                    82ns         994ns     6340ns
    
    For an io depth of 1, the new patch improves throughput by over two
    times (compared to the existing behavior, where buffered writes are
    processed by an io-worker process) and also the latency is considerably
    reduced. To achieve the same or better performance with the existing
    code an io depth of 4 is required.  Increasing the iodepth further does
    not lead to improvements.
    
    The tests have been run like this:
    
    ./fio --name=seq-writers --ioengine=psync --iodepth=1 --rw=write \
      --bs=4k --direct=0 --size=100000m --time_based --runtime=600   \
      --numjobs=1 --filename=...
    ./fio --name=seq-writers --ioengine=io_uring --iodepth=1 --rw=write \
      --bs=4k --direct=0 --size=100000m --time_based --runtime=600   \
      --numjobs=1 --filename=...
    ./fio --name=seq-writers --ioengine=libaio --iodepth=1 --rw=write \
      --bs=4k --direct=0 --size=100000m --time_based --runtime=600   \
      --numjobs=1 --filename=...
    
    Testing:
      This patch has been tested with xfstests, fsx, fio. xfstests shows no new
      diffs compared to running without the patch series.
    Reviewed-by: NFilipe Manana <fdmanana@suse.com>
    Signed-off-by: NStefan Roesch <shr@fb.com>
    Reviewed-by: NDavid Sterba <dsterba@suse.com>
    Signed-off-by: NDavid Sterba <dsterba@suse.com>
    926078b2
file.c 117.5 KB