Closed guoweifeng216 closed 3 years ago
Hi @guoweifeng216,
This isn't a bug in fio. You are trying to do unaligned writes to a block device when you've said "I promise all my I/O is well aligned and conforms to rules of O_DIRECT
".
[global]
filename=/dev/nvme0n1
[...]
bs_unaligned
direct=1
rw=write
[...]
[sequential write 1njobs]
[...]
bssplit=512/5:2.5k/5:5k/5:7.5k/5:10k/5:12.5/5:15k/5:17.5/5:20k/5:22.5k/5:25k/5:27.5k/5:30k/5:32.5k/5:35k/5:37.5k/5:40k/5:42.5k/5:45k/5:47.5k/5
Which led to:
fio: io_u error on file /dev/nvme0n1: Invalid argument: read offset=5120, buflen=32
direct=1
on your job so now you must obey all alignment rules abovebs_unaligned
which means the starting offset of I/Os may be unaligned versus their size ("fio: io_u error on file /dev/nvme0n1: Invalid argument: read offset=5152[...]" - notice how the offset is not a multiple of 512 :-( )% ./fio --name=test --ioengine=null --size=4k --number_ios=1 --bs=0.5k
bs: min value out of range: 0 (1 min)
fio: failed parsing bs=0.5k
bssplit=32.5k/5
is being parsed as 32 bytes which leads to "fio: io_u error on file /dev/nvme0n1: Invalid argument: read offset=5120, buflen=32"Ultimately your job is likely to cause lots of warnings and this isn't a bug in fio (it did what you asked it to). There's also a warning on the blocksize_unaligned documentation:
blocksize_unaligned, bs_unaligned
If set, fio will issue I/O units with any size within blocksize_range, not just multiples of the minimum size. This typically won’t work with direct I/O, as that normally requires sector alignment.
Please acknowledge the following before creating a ticket
Description of the bug: i run fio config file on ubuntu os report error
root@nvme:/home/nvme/fio_test/linux/ssd# fio seq_mix_50_Q32_bs_small_range_full_disk.fio sequential mix rw 1njobs: (g=0): rw=rw, bs=(R) 2B-45.0KiB, (W) 2B-45.0KiB, (T) 2B-45.0KiB, ioengine=libaio, iodepth=32 fio-3.1 Starting 1 thread fio: io_u error on file /dev/nvme0n1: Invalid argument: read offset=5120, buflen=32 fio: io_u error on file /dev/nvme0n1: Invalid argument: read offset=5152, buflen=40960 sequential mix rw 1njobs: No I/O performed by libaio, perhaps try --debug=io option for details? fio: pid=15443, err=22/file:io_u.c:1756, func=io_u error, error=Invalid argument
sequential mix rw 1njobs: (groupid=0, jobs=1): err=22 (file:io_u.c:1756, func=io_u error, error=Invalid argument): pid=15443: Tue Jun 8 22:33:22 2021 cpu : usr=0.00%, sys=0.00%, ctx=0, majf=0, minf=2 IO depths : 1=3.1%, 2=6.2%, 4=12.5%, 8=25.0%, 16=50.0%, 32=3.1%, >=64=0.0% submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0% complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0% issued rwt: total=32,0,0, short=0,0,0, dropped=0,0,0 latency : target=0, window=0, percentile=100.00%, depth=32
Run status group 0 (all jobs):
Disk stats (read/write): nvme0n1: ios=0/0, merge=0/0, ticks=0/0, in_queue=0, util=0.00%
Environment: root@nvme:/home/nvme/fio_test/linux/ssd# uname -a Linux nvme 5.4.0-42-generic #46~18.04.1-Ubuntu SMP Fri Jul 10 07:21:24 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux fio version: fio3.1
Reproduction steps seq_mix_50_Q32_bs_small_range_full_disk.fio [global] filename=/dev/nvme0n1 size=100% thread ioengine=libaio runtime=3600 continue_on_error=none exitall_on_error bs_unaligned direct=1 rw=write
[sequential write 1njobs] stonewall direct=1 iodepth=32 numjobs=1 bssplit=512/5:2.5k/5:5k/5:7.5k/5:10k/5:12.5/5:15k/5:17.5/5:20k/5:22.5k/5:25k/5:27.5k/5:30k/5:32.5k/5:35k/5:37.5k/5:40k/5:42.5k/5:45k/5:47.5k/5