axboe / fio

Flexible I/O Tester
GNU General Public License v2.0
5.25k stars 1.26k forks source link

Add accuracy into slat and clat calculation #1783

Closed vmitrofanov closed 3 months ago

vmitrofanov commented 3 months ago

It turns out that issue time stamp get after io_submit. https://github.com/axboe/fio/blob/6eaa6422fccf857e6b1a88492db805dafca8ee85/engines/libaio.c#L319-L321

https://github.com/axboe/fio/blob/6eaa6422fccf857e6b1a88492db805dafca8ee85/engines/libaio.c#L276-L290

It happens that io_submit can be blocked or have extra work in low-level drivers, like transmission before it returns from that syscall. It leads to slat and clat misinterpretation. In my case it added 150 us to slat. Of course this is not the best case scenario but may be it is better to get time stamp before io_submit and if it's succeeded use that time stamp.

Many thanks))

vincentkfu commented 3 months ago

The iouring ioengine has the same pattern. Submission latency seems to measure how long it takes fio to prepare the I/O and hand if off to the operating system. I can see the appeal of defining slat to be how long it takes fio to prepare the I/O before submitting it to the operating system, but this will likely be very close to zero and not very useful.

vmitrofanov commented 3 months ago

Thank you!