diff options
author | Miao Xie <miaox@cn.fujitsu.com> | 2010-10-26 20:57:29 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2010-10-29 11:25:45 -0400 |
commit | 19fe0a8b787d7c7f9318975b5a8c6e7e5e54e925 (patch) | |
tree | 78aea56ede5735ae3183f2c4b846773b8fd8155b /fs/btrfs/extent_io.h | |
parent | 897ca6e9b4fef86d5dfb6b31fd9f592ce6a47a42 (diff) |
Btrfs: Switch the extent buffer rbtree into a radix tree
This patch reduces the CPU time spent in the extent buffer search by using the
radix tree instead of the rbtree and using the rcu lock instead of the spin
lock.
I did a quick test by the benchmark tool[1] and found the patch improve the
file creation/deletion performance problem that I have reported[2].
Before applying this patch:
Create files:
Total files: 50000
Total time: 0.971531
Average time: 0.000019
Delete files:
Total files: 50000
Total time: 1.366761
Average time: 0.000027
After applying this patch:
Create files:
Total files: 50000
Total time: 0.927455
Average time: 0.000019
Delete files:
Total files: 50000
Total time: 1.292280
Average time: 0.000026
[1] http://marc.info/?l=linux-btrfs&m=128212635122920&q=p3
[2] http://marc.info/?l=linux-btrfs&m=128212635122920&w=2
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent_io.h')
-rw-r--r-- | fs/btrfs/extent_io.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h index 5691c7b590da..1c6d4f342ef7 100644 --- a/fs/btrfs/extent_io.h +++ b/fs/btrfs/extent_io.h | |||
@@ -85,7 +85,7 @@ struct extent_io_ops { | |||
85 | 85 | ||
86 | struct extent_io_tree { | 86 | struct extent_io_tree { |
87 | struct rb_root state; | 87 | struct rb_root state; |
88 | struct rb_root buffer; | 88 | struct radix_tree_root buffer; |
89 | struct address_space *mapping; | 89 | struct address_space *mapping; |
90 | u64 dirty_bytes; | 90 | u64 dirty_bytes; |
91 | spinlock_t lock; | 91 | spinlock_t lock; |
@@ -123,7 +123,7 @@ struct extent_buffer { | |||
123 | unsigned long bflags; | 123 | unsigned long bflags; |
124 | atomic_t refs; | 124 | atomic_t refs; |
125 | struct list_head leak_list; | 125 | struct list_head leak_list; |
126 | struct rb_node rb_node; | 126 | struct rcu_head rcu_head; |
127 | 127 | ||
128 | /* the spinlock is used to protect most operations */ | 128 | /* the spinlock is used to protect most operations */ |
129 | spinlock_t lock; | 129 | spinlock_t lock; |