On Tue, Aug 16, 2016 at 02:17:57PM +0800, Wang Xiaoguang wrote:
> In walk_down_tree(), we may call btrfs_lookup_extent_info() for same tree
> block many times, obviously unnecessary. Here we define a simple struct to
> record whether we already have gotten tree block's refs:
> struct node_refs {
> u64 bytenr[BTRFS_MAX_LEVEL];
> u64 refs[BTRFS_MAX_LEVEL];
> };
>
> I fill a disk partition with linux kernel source codes and use below
> test script to have performance test.
> #!/bin/bash
>
> echo 3 > /proc/sys/vm/drop_caches
> for ((i = 0; i < 20; i++)); do
> time ./btrfsck /dev/sdc5
> done 2>&1 | grep real | awk -F "[ms]" '{run_time += $2} END{print run_time / 20}'
>
> Before this patch, it averagely took 0.8447s for every btrfsck execution,
> and with this patch, it averagely took 0.7807s.
>
> Signed-off-by: Wang Xiaoguang <wangxg.fnst@xxxxxxxxxxxxxx>
Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html