Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fio: ioengines.c:346: td_io_queue: Assertion `res == 0' failed. #1520

Closed
1 task done
horshack-dpreview opened this issue Feb 18, 2023 · 0 comments
Closed
1 task done

Comments

@horshack-dpreview
Copy link
Contributor

Please acknowledge the following before creating a ticket

Description of the bug:
"fio: ioengines.c:346: td_io_queue: Assertion 'res == 0' failed" when -serialize_overlap=1, io_submit_mode=offload, and verify=crc32 are used in combination

Environment: Ubuntu 22.04.1 LTS
fio version: 3.33 (tip)

Reproduction steps

  1. modprobe brd rd_size=1024000 rd_nr=1 (creates ramdisk)
  2. fio -name=test -verify=crc32 -thread -size=16K -bs=512 -iodepth=1 -serialize_overlap 1 -filename=/dev/ram0 -rw=write -numjobs=1 -io_submit_mode=offload
horshack-dpreview added a commit to horshack-dpreview/fio that referenced this issue Feb 18, 2023
Assertion in ioengines.c::td_io_queue() fails for pthread_mutex_unlock()
on overlap_check mutex when serialize_overlap=1, io_submit_mode=offload,
and verify=<any> are used together.

backend.c::fio_io_sync() invokes td_io_queue(), which expects the caller
to have ownership of the overlap_check mutex when serialize_overlap
and offloading are configured, as part of the overlap-check interlock
with IO_U_F_FLIGHT. The mutex is not acquired for this path because it's
not an I/O requiring an overlap check.

The fix is to refine the conditional that triggers td_io_queue() to
release the overlap_check mutex. Rather than using broad config options,
the conditional now uses a new io_u flag named IO_U_F_OVERLAP_LOCK, which
is only set for the offload worker thread path that acquires the mutex.

Link: axboe#1520

Signed-off-by: Adam Horshack (horshack@live.com)
horshack-dpreview added a commit to horshack-dpreview/fio that referenced this issue Mar 1, 2023
Assertion in ioengines.c::td_io_queue() fails for pthread_mutex_unlock()
on overlap_check mutex when serialize_overlap=1, io_submit_mode=offload,
and verify=<any> are used together.

backend.c::fio_io_sync() invokes td_io_queue(), which expects the caller
to have ownership of the overlap_check mutex when serialize_overlap
and offloading are configured, as part of the overlap-check interlock
with IO_U_F_FLIGHT. The mutex is not acquired for this path because it's
not an I/O requiring an overlap check.

The fix is to refine the conditional that triggers td_io_queue() to
release the overlap_check mutex. Rather than using broad config options,
the conditional now uses a new io_u flag named IO_U_F_OVERLAP_LOCK, which
is only set for the offload worker thread path that acquires the mutex.

Link: axboe#1520

Signed-off-by: Adam Horshack (horshack@live.com)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant