Re: Why does 'direct' influence 'fsync'?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jan 26, 2013 at 5:28 PM, Jens Axboe <axboe@xxxxxxxxx> wrote:
> On Fri, Jan 25 2013, Stefan Hajnoczi wrote:
>> Is there a way to flush the disk write cache when O_DIRECT is in use?
>>
>> It seems that direct=1 causes the fsync setting to be ignored.  Asias
>> writes:
>>
>> > The O_DIRECT do affect the flush behaviour. e.g
>> >
>> > guest$ fio --fsync=100 --direct=1
>> > No virtio_blk_handle_flush is observed on host side every 100 IOs
>> >
>> > guest$ fio --fsync=100 --direct=0
>> > virtio_blk_handle_flush is observed on host side every 100 IOs
>>
>> Am I missing a reason for this behavior?  To me it seems weird since you
>> could already use --fsync=0 --direct=1 if you want to guarantee that
>> fsync is not called.  I don't see a need to override the fsync setting.
>
> You are right, fio should not be double guessing options like that. If
> you ask for fsync, you should get fsync.
>
> Does the below work for you?

Yes, thanks!

Tested-by: Stefan Hajnoczi <stefanha@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux