diff options
author | Josef Bacik <josef@redhat.com> | 2010-02-02 16:48:28 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2010-03-15 11:00:12 -0400 |
commit | 49958fd7dbb83cd4d65179d025940e01fe1fbacd (patch) | |
tree | 4a29e47c0935375968971450a2f2949bbd3cdd43 /fs/btrfs/ordered-data.h | |
parent | 4125bf761cd0786e1163e024c7c809ce2cc625bc (diff) |
Btrfs: change the ordered tree to use a spinlock instead of a mutex
The ordered tree used to need a mutex, but currently all we use it for is to
protect the rb_tree, and a spin_lock is just fine for that. Using a spin_lock
instead makes dbench run a little faster, 58 mb/s instead of 51 mb/s, and have
less latency, 3445.138 ms instead of 3820.633 ms.
Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ordered-data.h')
-rw-r--r-- | fs/btrfs/ordered-data.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/ordered-data.h b/fs/btrfs/ordered-data.h index 9116c6d0c5a9..bfbcebbb0adc 100644 --- a/fs/btrfs/ordered-data.h +++ b/fs/btrfs/ordered-data.h | |||
@@ -21,7 +21,7 @@ | |||
21 | 21 | ||
22 | /* one of these per inode */ | 22 | /* one of these per inode */ |
23 | struct btrfs_ordered_inode_tree { | 23 | struct btrfs_ordered_inode_tree { |
24 | struct mutex mutex; | 24 | spinlock_t lock; |
25 | struct rb_root tree; | 25 | struct rb_root tree; |
26 | struct rb_node *last; | 26 | struct rb_node *last; |
27 | }; | 27 | }; |
@@ -128,7 +128,7 @@ static inline int btrfs_ordered_sum_size(struct btrfs_root *root, | |||
128 | static inline void | 128 | static inline void |
129 | btrfs_ordered_inode_tree_init(struct btrfs_ordered_inode_tree *t) | 129 | btrfs_ordered_inode_tree_init(struct btrfs_ordered_inode_tree *t) |
130 | { | 130 | { |
131 | mutex_init(&t->mutex); | 131 | spin_lock_init(&t->lock); |
132 | t->tree = RB_ROOT; | 132 | t->tree = RB_ROOT; |
133 | t->last = NULL; | 133 | t->last = NULL; |
134 | } | 134 | } |