diff mbox

[2/4] Btrfs: don't look at the extent buffer level 3 times in a row

Message ID 1305149755-4413-2-git-send-email-josef@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Josef Bacik May 11, 2011, 9:35 p.m. UTC
We have a bit of debugging in btrfs_search_slot to make sure the level of the
cow block is the same as the original block we were cow'ing.  I don't think I've
ever seen this tripped, so kill it.  This saves us 2 kmap's per level in our
search.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
---
 fs/btrfs/ctree.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

Comments

David Sterba May 12, 2011, 3:42 p.m. UTC | #1
Hi,

On Wed, May 11, 2011 at 05:35:53PM -0400, Josef Bacik wrote:
> We have a bit of debugging in btrfs_search_slot to make sure the level of the
> cow block is the same as the original block we were cow'ing.  I don't think I've
> ever seen this tripped, so kill it.  This saves us 2 kmap's per level in our
> search.  Thanks,

I think it may be worth to add a CONFIG_BTRFS_DEBUG to switch on some
(even expensive) checks, eg. like this one, rather than deleting them.


david
--
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
Josef Bacik May 12, 2011, 7:36 p.m. UTC | #2
On Thu, May 12, 2011 at 05:42:47PM +0200, David Sterba wrote:
> Hi,
> 
> On Wed, May 11, 2011 at 05:35:53PM -0400, Josef Bacik wrote:
> > We have a bit of debugging in btrfs_search_slot to make sure the level of the
> > cow block is the same as the original block we were cow'ing.  I don't think I've
> > ever seen this tripped, so kill it.  This saves us 2 kmap's per level in our
> > search.  Thanks,
> 
> I think it may be worth to add a CONFIG_BTRFS_DEBUG to switch on some
> (even expensive) checks, eg. like this one, rather than deleting them.
> 

I had thought about that, but then decided to be lazy.  Thanks,

Josef
--
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
diff mbox

Patch

diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 009bcf7..f7a0a64 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -1672,9 +1672,6 @@  again:
 		}
 cow_done:
 		BUG_ON(!cow && ins_len);
-		if (level != btrfs_header_level(b))
-			WARN_ON(1);
-		level = btrfs_header_level(b);
 
 		p->nodes[level] = b;
 		if (!p->skip_locking)