Duncan <[email protected]> schrieb:

> P. Remek posted on Tue, 10 Feb 2015 18:44:33 +0100 as excerpted:
> 
>> In the test, I use --direct=1 parameter for fio which basically does
>> O_DIRECT on target file. The O_DIRECT should guarantee that the
>> filesystem cache is bypassed and IO is sent directly to the underlaying
>> storage. Are you saying that btrfs buffers writes despite of O_DIRECT?
> 
> I'm out of my (admin, no claims at developer) league on that.  I see
> someone else replied, and would defer to them on this.

I don't think that O_DIRECT can work efficiently on COW filesystems. It 
probably has a negative effect and cannot be faster as normal access. Linus 
itself said one time that O_DIRECT is broken and should go away, and instead 
cache hinting should be used.

Think of this: For the _unbuffered_ direct-io request to be fulfilled the 
file system has to go through its COW logic first which it otherwise had 
buffered and done in background. Bypassing the cache is probably only a 
side-effect of O_DIRECT, not its purpose.

At least I'd try with a nocow-file for the benchmark if you still have to 
use O_DIRECT.

-- 
Replies to list only preferred.

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to