4s4yt94l0Z2utwiPHFABbE changeset

Changeset313932316263 (b)
ParentNone (a)
ab
0+#!/bin/bash
0+
0+mnt=/mnt/sdd
0+dev=/dev/sdd
0+
0+umount $dev &> /dev/null
0+mkfs.btrfs -f -n 4096 $dev
0+mount $dev $mnt
0+
0+echo -e "Filling fs...\n"
0+
0+# Ensure we get the fs tree with 3+ levels.
0+xattr_val=$(printf '%0.sX' $(seq 1 3850))
0+for ((i = 1; i <= 10000; i++)); do
0+        echo -n > $mnt/filler_$i
0+        setfattr -n user.x1 -v $xattr_val $mnt/filler_$i
0+done
0+
0+xfs_io -f -c "pwrite 0 128K" $mnt/foobar
0+
0+# Creating snapshots..."
0+for ((i = 1; i <= 1000; i++)); do
0+        btrfs subvolume snapshot -r $mnt $mnt/snap_$i
0+done
0+
0+extent_bytenr=$(btrfs inspect-internal dump-tree -t 5 $dev | egrep -A 2 EXTENT_DATA | perl -ne 'print $1 if /disk byte (\d+)/')
0+echo -e "\nExtent location at disk bytenr $extent_bytenr\n"
0+
0+ts_before=$(date +%s)
0+btrfs inspect-internal logical-resolve -P $extent_bytenr $mnt | wc -l
0+ts_after=$(date +%s)
0+echo -e "\nlogical-resolve took $((ts_after - ts_before)) seconds\n"
0+
0+ts_before=$(date +%s)
0+btrfs send -f /dev/null $mnt/snap_1
0+ts_after=$(date +%s)
0+echo -e "\nsend took $((ts_after - ts_before)) seconds\n"
0+
0+
0+
0+
0+
0+
0+
0+
0+
0+
0+
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
--- Revision None
+++ Revision 313932316263
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+mnt=/mnt/sdd
+dev=/dev/sdd
+
+umount $dev &> /dev/null
+mkfs.btrfs -f -n 4096 $dev
+mount $dev $mnt
+
+echo -e "Filling fs...\n"
+
+# Ensure we get the fs tree with 3+ levels.
+xattr_val=$(printf '%0.sX' $(seq 1 3850))
+for ((i = 1; i <= 10000; i++)); do
+ echo -n > $mnt/filler_$i
+ setfattr -n user.x1 -v $xattr_val $mnt/filler_$i
+done
+
+xfs_io -f -c "pwrite 0 128K" $mnt/foobar
+
+# Creating snapshots..."
+for ((i = 1; i <= 1000; i++)); do
+ btrfs subvolume snapshot -r $mnt $mnt/snap_$i
+done
+
+extent_bytenr=$(btrfs inspect-internal dump-tree -t 5 $dev | egrep -A 2 EXTENT_DATA | perl -ne 'print $1 if /disk byte (\d+)/')
+echo -e "\nExtent location at disk bytenr $extent_bytenr\n"
+
+ts_before=$(date +%s)
+btrfs inspect-internal logical-resolve -P $extent_bytenr $mnt | wc -l
+ts_after=$(date +%s)
+echo -e "\nlogical-resolve took $((ts_after - ts_before)) seconds\n"
+
+ts_before=$(date +%s)
+btrfs send -f /dev/null $mnt/snap_1
+ts_after=$(date +%s)
+echo -e "\nsend took $((ts_after - ts_before)) seconds\n"
+
+
+
+
+
+
+
+
+
+
+