fio
fio copied to clipboard
Windows write-through and buffered IOs are not being acknowledged/enforced
Hello I am trying to get FIO to do write-through and buffered IOs.
FIO version 3.17
I am using --direct=1 --buffered=1 but they are not being passed onto the file system.
In the first link is the write through being enforced by DiskSpd

In this second link is FIO with --direct=1 --buffered=1, as you can see the flags are not being received by the file system. I have done Xperf traces that confirm my findings.

I can upload some Xperfs if they would help.
thank you Astolfo
@Gt3pccb It doesn't make sense to use direct=1 and buffered=1 in the same job - they are antonyms of each other...
@sitsofe they are 2 different flags, and they are not antonyms in windows. The -file_flag_no_buffering and -file_flag_no_write_through are not mutually exclusive.
Possible configurations for Buffered/write-though
Buffered + write-through Unbuffered + write-through NoWriteThrough + Buffered NoWriteThrough + Unbuffered
https://docs.microsoft.com/en-us/windows/win32/fileio/file-caching https://docs.microsoft.com/en-us/windows/win32/fileio/file-buffering
@Gt3pccb direct and buffered are antonyms in fio and map to the same option (direct). If you want to control writethrough I believe that's done with sync=1 with the windowaio ioengine (see https://github.com/axboe/fio/blob/4e8dab275215925707280885c2938f8b0cc28b1c/engines/windowsaio.c#L223-L226 )...
Hello Sitsofe, can we make it so they are not antonyms? There are some optimization changes in the storage stack and Bitlocker for different NvME and RDIM use-cases that would leverage some of the combinations that can't be tested under the current FIO antonyms definition. Thank you
I think you want windowsio engine options for that. This is different from how all other operating systems work, and we obviously can't change paradigms that have been consistently the same in fio since day 1.
With windowsaio options and proper documentation, that would be the way to go.
@Gt3pccb I'm not sure I follow. For the four cases you defined with the options (direct, sync) that fio has already when using the windowsaio engine:
- Buffered + write-through :
direct=0 sync=sync - Unbuffered + write-through:
direct=1 sync=sync - NoWriteThrough + Buffered:
sync=none direct=0(the default) - NoWriteThrough + Unbuffered:
sync=none direct=1
Do these give you the cases you are after?