Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Wang Shilong <wangshilong1991@gmail.com>
To: bo.li.liu@oracle.com
Cc: Kai Krakow <hurikhan77@gmail.com>, linux-btrfs@vger.kernel.org
Subject: Re: btrfs performance, sudden drop to 0 IOPs
Date: Fri, 13 Feb 2015 11:55:54 +0800	[thread overview]
Message-ID: <4F8CF413-337F-4E67-9DA1-C738390416C4@gmail.com> (raw)
In-Reply-To: <20150213024624.GB25697@localhost.localdomain>

Hello guys,

> 
> On Thu, Feb 12, 2015 at 05:33:41AM +0100, Kai Krakow wrote:
>> Duncan <1i5t5.duncan@cox.net> 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.
> 
> Hmm, not true in btrfs, the COW logic mentioned above is nothing but to allocate
> a NEW extent, and it's not done in background.
> 
> Comparing to nocow logic, the main difference comes from 
> a) COW files' calculating checksums of the dirty data in DIO pages which nocow files don't need to.
> b) their endio handlers.
> 
> Or am I missing something?


We did benchmark Btrfs aio/dio performance before, we noticed one big differences
from COW and nocow is not only checksum but checksum cost more metadata, which will
make Btrfs performance drop suddenly for a while, because of metadata reservation.


> 
> Thanks,
> 
> -liubo
>> 
>> 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 majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Best Regards,
Wang Shilong


  reply	other threads:[~2015-02-13  3:56 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-09 17:26 btrfs performance, sudden drop to 0 IOPs P. Remek
2015-02-09 19:56 ` Kai Krakow
2015-02-09 22:21   ` P. Remek
2015-02-10  6:58     ` Kai Krakow
2015-02-10  4:42 ` Duncan
2015-02-10 17:44   ` P. Remek
2015-02-12  2:10     ` Duncan
2015-02-12  4:33       ` Kai Krakow
2015-02-12 12:21         ` Austin S Hemmelgarn
2015-02-12 19:42           ` Kai Krakow
2015-02-13 13:16             ` P. Remek
2015-02-13 18:26               ` Kai Krakow
2015-02-13 13:08           ` P. Remek
2015-02-13  2:46         ` Liu Bo
2015-02-13  3:55           ` Wang Shilong [this message]
2015-02-13 13:18             ` P. Remek
2015-02-11 12:40 ` Austin S Hemmelgarn
2015-02-12  4:59 ` Liu Bo
2015-02-13 13:06   ` P. Remek
2015-02-13 14:08     ` Liu Bo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F8CF413-337F-4E67-9DA1-C738390416C4@gmail.com \
    --to=wangshilong1991@gmail.com \
    --cc=bo.li.liu@oracle.com \
    --cc=hurikhan77@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox