Skip to content

Commit

Permalink
fix: io_uring sqpoll issue_time empty when kernel not yet read sq
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
yangjueji committed Jul 6, 2023
1 parent 8e2b81b commit 10bad6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion engines/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ static int fio_ioring_commit(struct thread_data *td)
*/
if (o->sqpoll_thread) {
struct io_sq_ring *ring = &ld->sq_ring;
unsigned start = *ld->sq_ring.head;
unsigned start = *ld->sq_ring.tail - ld->queued;
unsigned flags;

flags = atomic_load_acquire(ring->flags);
Expand Down

0 comments on commit 10bad6b

Please sign in to comment.