linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Mason <clm@fb.com>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>
Cc: Filipe Manana <fdmanana@kernel.org>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
	Filipe Manana <fdmanana@suse.com>
Subject: Re: [PATCH] Btrfs: fix order by which delayed references are run
Date: Mon, 27 Jul 2015 09:50:47 -0400	[thread overview]
Message-ID: <20150727135047.GG28964@ret.masoncoding.com> (raw)
In-Reply-To: <55B5F854.10303@cn.fujitsu.com>

On Mon, Jul 27, 2015 at 05:22:28PM +0800, Qu Wenruo wrote:
> 
> 
> Filipe Manana wrote on 2015/07/27 09:26 +0100:
> >On Mon, Jul 27, 2015 at 7:53 AM, Qu Wenruo <quwenruo@cn.fujitsu.com> wrote:
> >>Hi Filipe,
> >
> >Hi Qu,
> >
> >>
> >>Sorry for the late reply after it is already merged,
> >>but I'm a little concerned about the extra loop to find the first inc
> >>delayed ref.
> >>
> >>It may take some extra time when there are a lot of delayed refs.
> >>
> >>What about allowing deleting the extent item at dec delayed ref time and
> >>then add it back for later inc delayed refs?
> >
> >So, the reason I did it this way is simplicity - it's pretty much what
> >the pre 4.2-rc1 [1] code did, but slightly more efficient because it
> >iterates a linked list rather than a red black tree using rb_next().
> >So it seems somewhat odd that you're worrying about this after a
> >functional fix when we pretty much always had this behavior in
> >place...
> >
> >Given the complexity of what you propose, I would prefer if we have a
> >benchmark that indeed shows this is a performance critical area (I
> >don't think this list can get that huge, but I might be wrong).
> I agree with you that this may not be a performance hotspot.
> 
> And in fact, before the qgroup patchset, we tested the list implement of
> delayed ref for performance regression, and the difference is so little that
> can be easily ignored.
> So I think even we skip the loop, the performance will only change little.
> 
> One of the main purpose to change the delayed ref to list, is to make it a
> little more straightforward, without the hard to understand/review rb tree
> compare.
> So I hope there is another more simple and straightforward one.
> 
> But as you mentioned, your fix is already simple enough, and after a short
> code search, my idea to fix may not be as simple as I thought.
> 
> So sorry for the disturb, and thanks for your fix again.

Thanks for giving this some extra review.  For now I'm happy with the
tradeoff, but if it shows up in profiles we can look harder.

-chris

      reply	other threads:[~2015-07-27 13:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-09 14:50 [PATCH] Btrfs: fix order by which delayed references are run fdmanana
2015-07-10  0:28 ` Qu Wenruo
2015-07-27  6:53 ` Qu Wenruo
2015-07-27  8:26   ` Filipe Manana
2015-07-27  9:22     ` Qu Wenruo
2015-07-27 13:50       ` Chris Mason [this message]

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=20150727135047.GG28964@ret.masoncoding.com \
    --to=clm@fb.com \
    --cc=fdmanana@kernel.org \
    --cc=fdmanana@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo@cn.fujitsu.com \
    /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).