linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: josef@toxicpanda.com
To: kernel-team@fb.com, linux-btrfs@vger.kernel.org
Subject: [RFC][0/10] Cleanup and enhance delayed refs
Date: Mon, 11 Sep 2017 17:12:26 -0400	[thread overview]
Message-ID: <1505164356-13474-1-git-send-email-jbacik@fb.com> (raw)

I'm leaving for Linux Plumbers tomorrow so I wanted to get this out for people
to look at and see if there were any general comments.  These patches have only
been compiled, not tested in any way, so I wouldn't recommend trying them.  They
do a few things

1) Cleanup empty delayed ref head handling.  We clean this up in a variety of
different ways in different places, so I've unified it all in one helper and
reduced the complexity of __btrfs_run_delayed_refs.

2) Removed the btrfs_delayed_ref_node from the btrfs_delayed_ref_head.  This
used to be this way because we had heads and nodes all on the same list.  Since
this is no longer the case it's just wasted space and weird complexity, so kill
it.

3) Track delayed ref updates in an rb_tree on the head ref instead of in a list.
Our merging stuff really sucks if we end up with lots of different changes to
the same block.  You can end up blowing loads of cpu time during the transaction
commit, which isn't helpful.  With the tree we can not loop as much, and make
our insert time merging much better.

Here is the diffstat

 fs/btrfs/backref.c           |   9 +-
 fs/btrfs/delayed-ref.c       | 294 ++++++++++++++++-----------------
 fs/btrfs/delayed-ref.h       |  54 +++----
 fs/btrfs/disk-io.c           |  22 +--
 fs/btrfs/extent-tree.c       | 376 ++++++++++++++++++++-----------------------
 include/trace/events/btrfs.h |  15 +-
 6 files changed, 363 insertions(+), 407 deletions(-)

Let me know if you have any questions or feedback.  Thanks,

Josef

             reply	other threads:[~2017-09-11 21:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-11 21:12 josef [this message]
2017-09-11 21:12 ` [PATCH 01/10] btrfs: add a helper to return a head ref josef
2017-09-11 21:12 ` [PATCH 02/10] btrfs: move extent_op cleanup to a helper josef
2017-09-11 21:12 ` [PATCH 03/10] btrfs: breakout empty head " josef
2017-09-11 21:12 ` [PATCH 04/10] btrfs: move ref_mod modification into the if (ref) logic josef
2017-09-11 21:12 ` [PATCH 05/10] btrfs: move all ref head cleanup to the helper function josef
2017-09-11 21:12 ` [PATCH 06/10] btrfs: remove delayed_ref_node from ref_head josef
2017-09-11 21:12 ` [PATCH 07/10] btrfs: remove type argument from comp_tree_refs josef
2017-09-12 16:08   ` Timofey Titovets
2017-09-11 21:12 ` [PATCH 08/10] btrfs: switch args for comp_*_refs josef
2017-09-12 16:21   ` Timofey Titovets
2017-09-12 16:35     ` Timofey Titovets
2017-09-11 21:12 ` [PATCH 09/10] btrfs: add a comp_refs() helper josef
2017-09-11 21:12 ` [PATCH 10/10] btrfs: track refs in a rb_tree instead of a list josef

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=1505164356-13474-1-git-send-email-jbacik@fb.com \
    --to=josef@toxicpanda.com \
    --cc=kernel-team@fb.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).