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

fix: io_uring sqpoll issue_time empty when kernel not yet read sq #1594

Merged
merged 1 commit into from
Jul 15, 2023

Conversation

yangjueji
Copy link
Contributor

In io_uring sqpoll mode, when kernel side thread has not yet read the sqring before second fio_ioring_commit() called, the sq_ring.head will remain the same. The second
fio_ioring_commit() will initialize the wrong io_u's issue_time. The old(in head) io_u‘s issue_time will to be initialized twice and new(in tail - 1) io_u's issue_time will not to be initialized. This problem will cause clat is weird, sometimes larger than lat.

Situation:

  1. fio_ioring_queue(td, io_u_a) // head -> io_u_a; tail -> io_u_a + 1
  2. fio_ioring_commit(td) // initial io_u_a.issue_time
  3. fio_ioring_queue(td, io_u_b) // head -> io_u_a; tail -> io_u_b + 1
  4. fio_ioring_commit(td) // initial io_u_a.issue_time again
  5. kernel thread read sq_ring, // head += 2

io_u_b.issue_time is never initilized.

In io_uring sqpoll mode, when kernel side thread has not yet read 
the sqring before second fio_ioring_commit() called, the 
sq_ring.head will remain the same. The second 
fio_ioring_commit() will initialize the wrong io_u's issue_time. 
The old(in head) io_u‘s issue_time will to be initialized twice and 
new(in tail - 1) io_u's issue_time will not to be initialized.
This problem will cause clat is weird, sometimes larger than lat.

Signed-off-by: Jueji Yang <jueji.yang@gmail.com>
@ankit-sam
Copy link
Contributor

Hi @yangjueji yeah I also observed the issue you mentioned with higher queue depth, thanks for submitting the change. It works.
c011bf1 partially fixed the sqpoll clat reporting issue (iodepth = 1). it never worked properly for iodepth > 1.

@axboe axboe merged commit 04361e9 into axboe:master Jul 15, 2023
10 checks passed
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

Successfully merging this pull request may close these issues.

3 participants