fio: fix aio trim completion latencies
PATCH 1/1 fio: fix aio trim completion latencies
From: Vincent Fu <[email protected]>
The io_uring, libaio, and posixaio ioengines actually carry out synchronous trim operations, but latency timestamps are recorded as if the trims were issued asynchronously. This patch fixes how timestamps are recorded for trim operations issued by these ioengines.
--- engines/io_uring.c | 1 + engines/libaio.c | 1 + engines/posixaio.c | 1 + ioengines.c | 8 ++++++-- ioengines.h | 2 ++ 5 files changed, 11 insertions(+), 2 deletions(-)
engines/io_uring.c +1 -0
@@ -533,6 +533,7 @@ static int fio_ioring_io_u_init(struct thread_data *td, struct io_u *io_u)static struct ioengine_ops ioengine = { .name ="io_uring" , .version =FIO_IOOPS_VERSION , + .flags =FIO_ASYNCIO_SYNC_TRIM , .init = fio_ioring_init, .post_init = fio_ioring_post_init, .io_u_init = fio_ioring_io_u_init,
engines/libaio.c +1 -0
@@ -429,6 +429,7 @@ static int fio_libaio_init(struct thread_data *td)static struct ioengine_ops ioengine = { .name ="libaio" , .version =FIO_IOOPS_VERSION , + .flags =FIO_ASYNCIO_SYNC_TRIM , .init = fio_libaio_init, .post_init = fio_libaio_post_init, .prep = fio_libaio_prep,
engines/posixaio.c +1 -0
@@ -243,6 +243,7 @@ static int fio_posixaio_init(struct thread_data *td)static struct ioengine_ops ioengine = { .name ="posixaio" , .version =FIO_IOOPS_VERSION , + .flags =FIO_ASYNCIO_SYNC_TRIM , .init = fio_posixaio_init, .prep = fio_posixaio_prep, .queue = fio_posixaio_queue,
ioengines.c +6 -2
@@ -308,7 +308,9 @@ enum fio_q_status td_io_queue(struct thread_data *td, struct io_u *io_u) io_u->error =0 ; io_u->resid =0 ; -if (td_ioengine_flagged (td,FIO_SYNCIO )) { +if (td_ioengine_flagged (td,FIO_SYNCIO ) || + (td_ioengine_flagged (td,FIO_ASYNCIO_SYNC_TRIM ) && + io_u->ddir ==DDIR_TRIM )) {if (fio_fill_issue_time (td))fio_gettime (&io_u->issue_time,NULL );
@@ -389,7 +391,9 @@ enum fio_q_status td_io_queue(struct thread_data *td, struct io_u *io_u)td_io_commit (td); } -if (!td_ioengine_flagged (td,FIO_SYNCIO )) { +if (!td_ioengine_flagged (td,FIO_SYNCIO ) && + (!td_ioengine_flagged (td,FIO_ASYNCIO_SYNC_TRIM ) || + io_u->ddir !=DDIR_TRIM )) {if (fio_fill_issue_time (td))fio_gettime (&io_u->issue_time,NULL );
ioengines.h +2 -0
@@ -63,6 +63,8 @@ enum fio_ioengine_flags {FIO_FAKEIO =1 <<11 ,/* engine pretends to do IO */ FIO_NOSTATS =1 <<12 ,/* don't do IO stats */ FIO_NOFILEHASH =1 <<13 ,/* doesn't hash the files for lookup later. */ +FIO_ASYNCIO_SYNC_TRIM + = 1 << 14 /* io engine has async ->queue except for trim */ };/*
Signature · 1 line
2.17.1
Quoted 6 lines · On 7/8/19 1:23 PM, [email protected] wrote:
From: Vincent Fu <[email protected]>
The
io_uring, libaio, and posixaio ioengines actually carry out synchronous trim operations, but latency timestamps are recorded as if the trims were issued asynchronously. This patch fixes how timestamps are recorded for trim operations issued by these ioengines.
Thanks for fixing this Vincent, applied.
Signature · 1 line
Jens Axboe