Hi,
I have problem using fio with fdp mode (flexible data placement) in qemu guest...
Anyone knows how to do it successfully? Many thanks!
I have used very recent code of fio and qemu, in which already include fdp related commits.
fio: commit b311162c
qemu: commit 0d52116f
guest os: ubuntu 22.04, with default kernel v.5.15.0-43-generic
Here are the commands I use:
1. qemu
# qemu-system-86_64 -hda ubuntu.qcow2 -boot d -net nic -net user -m 16384 -smp 8 -cpu host -enable-kvm \
-device nvme-subsys,id=nvme-subsys-0,nqn=subsys0,fdp=on,fdp.nrg=3,fdp.nruh=16,fdp.runs=96M \
-device nvme,id=nvme0,serial=mynvm,subsys=nvme-subsys-0 \
-drive file=nvm-1.qcow2,id=nvm-1,if=none \
-device nvme-ns,drive=nvm-1,fdp.ruhs=0-15,bus=nvme0
2. fio
# fio --ioengine=io_uring_cmd --cmd_type=nvme --filename=/dev/ng0n1 --fdp=1 --fdp_pli=0-15 \
--iodepth=1 --direct=1 --rw=randwrite --bs=4K --size=1G \
--runtime=10 --time_based --group_reporting --name=job1
Then fio fails, error:
fio: pid=1884, err=22/file:engines/io_uring.c:1089, func=io_queue_init, error=Invalid argument
So I traced code and found this error occurs at syscall(__NR_io_uring_setup, depth, &p) in fio_ioring_cmd_queue_init() of fio/engines/io_uring.c
(Here: https://github.com/axboe/fio/blob/b311162c37a2867873e1222ce6b5f38c88be4d80/engines/io_uring.c#L955 )
The variable p is a struct io_uring_params, so I print its content right before the syscall():
sq_entries=0, cq_entries=1, flags=15624, sq_thread_cpu=0, sq_thread_idle=0, features=0, wq_fd=0, resv[0]=0, resv[1]=0, resv[2]=0
sq_entries=0, cq_entries=1, flags=3336, sq_thread_cpu=0, sq_thread_idle=0, features=0, wq_fd=0, resv[0]=0, resv[1]=0, resv[2]=0
sq_entries=0, cq_entries=1, flags=3080, sq_thread_cpu=0, sq_thread_idle=0, features=0, wq_fd=0, resv[0]=0, resv[1]=0, resv[2]=0
sq_entries=0, cq_entries=1, flags=3072, sq_thread_cpu=0, sq_thread_idle=0, features=0, wq_fd=0, resv[0]=0, resv[1]=0, resv[2]=0
Still can't figure out what's wrong...
Finally, I suspect my io_uring library is too old to support fdp?
So I make install the latest liburing (https://github.com/axboe/liburing), but still same fio failure.