fio icon indicating copy to clipboard operation
fio copied to clipboard

Windows write-through and buffered IOs are not being acknowledged/enforced

Open Gt3pccb opened this issue 3 years ago • 6 comments

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

Write-Through

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.

FIO

I can upload some Xperfs if they would help.

thank you Astolfo

Gt3pccb avatar Feb 10 '22 20:02 Gt3pccb

@Gt3pccb It doesn't make sense to use direct=1 and buffered=1 in the same job - they are antonyms of each other...

sitsofe avatar Feb 14 '22 08:02 sitsofe

@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 avatar Feb 14 '22 23:02 Gt3pccb

@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 )...

sitsofe avatar Feb 15 '22 20:02 sitsofe

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

Gt3pccb avatar Feb 21 '22 18:02 Gt3pccb

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.

axboe avatar Feb 21 '22 18:02 axboe

@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:

  1. Buffered + write-through : direct=0 sync=sync
  2. Unbuffered + write-through: direct=1 sync=sync
  3. NoWriteThrough + Buffered: sync=none direct=0 (the default)
  4. NoWriteThrough + Unbuffered: sync=none direct=1

Do these give you the cases you are after?

sitsofe avatar Feb 23 '22 15:02 sitsofe