linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <jbacik@fb.com>
To: <bo.li.liu@oracle.com>, Filipe David Borba Manana <fdmanana@gmail.com>
Cc: <linux-btrfs@vger.kernel.org>, Chris Mason <clm@fb.com>
Subject: Re: [PATCH] Btrfs: faster/more efficient insertion of file extent items
Date: Wed, 7 May 2014 11:26:56 -0400	[thread overview]
Message-ID: <536A50C0.6010907@fb.com> (raw)
In-Reply-To: <20140507152100.GA2702@localhost.localdomain>

On 05/07/2014 11:21 AM, Liu Bo wrote:
> On Sun, Feb 09, 2014 at 11:45:12PM +0000, Filipe David Borba Manana wrote:
>> This is an extension to my previous commit titled:
>>
>>    "Btrfs: faster file extent item replace operations"
>>    (hash 1acae57b161ef1282f565ef907f72aeed0eb71d9)
>>
>> Instead of inserting the new file extent item if we deleted existing
>> file extent items covering our target file range, also allow to insert
>> the new file extent item if we didn't find any existing items to delete
>> and replace_extent != 0, since in this case our caller would do another
>> tree search to insert the new file extent item anyway, therefore just
>> combine the two tree searches into a single one, saving cpu time, reducing
>> lock contention and reducing btree node/leaf COW operations.
>>
>> This covers the case where applications keep doing tail append writes to
>> files, which for example is the case of Apache CouchDB (its database and
>> view index files are always open with O_APPEND).
>
> (I'm tracking a bug which is very hard to reproduce and the stack seems to
> locate on this area.)
>
> Even I know that this has been merged, I still have to say that this just
> makes the code nearly hard-to-maintained.
>
> __btrfs_drop_extents() has already been one of the most complex function since
> it was written, but now it's become more and more complex!
>
> I'm not sure whether the gained performance number deserves that kind of
> complexity, man, to be honest, try to ask yourself how much time you'll spend in
> re-understanding the code and all the details.
>

It's just a complex operation anyway, so really it's going to suck no 
matter what.  What I would like to see is some sanity tests committed 
that test the various corner cases of btrfs_drop_extents so when we make 
these sort of changes we can be sure we're not breaking anything.

So in fact that's the new requirement, whoever wants to touch 
btrfs_drop_extents next has to make sanity tests for it first, and then 
they can do what they want, this includes cleaning it up.  Thanks,

Josef


  reply	other threads:[~2014-05-07 15:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-09 23:45 [PATCH] Btrfs: faster/more efficient insertion of file extent items Filipe David Borba Manana
2014-05-07 15:21 ` Liu Bo
2014-05-07 15:26   ` Josef Bacik [this message]
2014-05-07 19:22   ` Filipe David Manana

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=536A50C0.6010907@fb.com \
    --to=jbacik@fb.com \
    --cc=bo.li.liu@oracle.com \
    --cc=clm@fb.com \
    --cc=fdmanana@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;
as well as URLs for NNTP newsgroup(s).