diff options
author | Josef Bacik <jbacik@fusionio.com> | 2013-10-07 15:18:52 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-11-11 21:56:31 -0500 |
commit | 0be5dc67c445230b0889dba63defba9a9e5561b4 (patch) | |
tree | 0265e91c3b07d10e75a95627295680e1c733c355 | |
parent | 2b1360da35877cd969ed83884d8989ba778254d0 (diff) |
Btrfs: fixup reserved trace points
In trying to track down where we were leaking reserved space I noticed our
reserve extent tracepoints are a little off. First we were saying that the
reserved space had been alloced in btrfs_reserve_extent, which isn't the case,
this needs to be triggered when we actually allocate the space when we run the
delayed ref. We were also missing a few places where we should have been
tracing the btrfs_reserve_extent_free tracepoint. With these in place I was
able to put together where we were leaking reserved space. Thanks,
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
-rw-r--r-- | fs/btrfs/extent-tree.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 54ee542c705e..65401d7ef663 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -5262,6 +5262,8 @@ static int pin_down_extent(struct btrfs_root *root, | |||
5262 | 5262 | ||
5263 | set_extent_dirty(root->fs_info->pinned_extents, bytenr, | 5263 | set_extent_dirty(root->fs_info->pinned_extents, bytenr, |
5264 | bytenr + num_bytes - 1, GFP_NOFS | __GFP_NOFAIL); | 5264 | bytenr + num_bytes - 1, GFP_NOFS | __GFP_NOFAIL); |
5265 | if (reserved) | ||
5266 | trace_btrfs_reserved_extent_free(root, bytenr, num_bytes); | ||
5265 | return 0; | 5267 | return 0; |
5266 | } | 5268 | } |
5267 | 5269 | ||
@@ -5965,6 +5967,7 @@ void btrfs_free_tree_block(struct btrfs_trans_handle *trans, | |||
5965 | 5967 | ||
5966 | btrfs_add_free_space(cache, buf->start, buf->len); | 5968 | btrfs_add_free_space(cache, buf->start, buf->len); |
5967 | btrfs_update_reserved_bytes(cache, buf->len, RESERVE_FREE); | 5969 | btrfs_update_reserved_bytes(cache, buf->len, RESERVE_FREE); |
5970 | trace_btrfs_reserved_extent_free(root, buf->start, buf->len); | ||
5968 | pin = 0; | 5971 | pin = 0; |
5969 | } | 5972 | } |
5970 | out: | 5973 | out: |
@@ -6592,8 +6595,6 @@ again: | |||
6592 | } | 6595 | } |
6593 | } | 6596 | } |
6594 | 6597 | ||
6595 | trace_btrfs_reserved_extent_alloc(root, ins->objectid, ins->offset); | ||
6596 | |||
6597 | return ret; | 6598 | return ret; |
6598 | } | 6599 | } |
6599 | 6600 | ||
@@ -6705,6 +6706,7 @@ static int alloc_reserved_file_extent(struct btrfs_trans_handle *trans, | |||
6705 | ins->objectid, ins->offset); | 6706 | ins->objectid, ins->offset); |
6706 | BUG(); | 6707 | BUG(); |
6707 | } | 6708 | } |
6709 | trace_btrfs_reserved_extent_alloc(root, ins->objectid, ins->offset); | ||
6708 | return ret; | 6710 | return ret; |
6709 | } | 6711 | } |
6710 | 6712 | ||
@@ -6777,6 +6779,8 @@ static int alloc_reserved_tree_block(struct btrfs_trans_handle *trans, | |||
6777 | ins->objectid, ins->offset); | 6779 | ins->objectid, ins->offset); |
6778 | BUG(); | 6780 | BUG(); |
6779 | } | 6781 | } |
6782 | |||
6783 | trace_btrfs_reserved_extent_alloc(root, ins->objectid, root->leafsize); | ||
6780 | return ret; | 6784 | return ret; |
6781 | } | 6785 | } |
6782 | 6786 | ||