Home Home > GIT Browse > SLE15-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2019-05-15 17:05:54 +0800
committerQu Wenruo <wqu@suse.com>2019-05-15 18:22:37 +0800
commit81e469327a35bba822048364477c9276e853f236 (patch)
tree284f047ba9d983dcaa050bcfe9c15ce8300c361c
parentec353a9f06d60b2cb8941a1ceaf9cae17e6a0dbf (diff)
btrfs: qgroup: Don't scan leaf if we're modifying reloc tree
(bsc#1063638 bsc#1128052 bsc#1108838).
-rw-r--r--patches.suse/0009-btrfs-qgroup-Don-t-scan-leaf-if-we-re-modifying-relo.patch68
-rw-r--r--series.conf1
2 files changed, 69 insertions, 0 deletions
diff --git a/patches.suse/0009-btrfs-qgroup-Don-t-scan-leaf-if-we-re-modifying-relo.patch b/patches.suse/0009-btrfs-qgroup-Don-t-scan-leaf-if-we-re-modifying-relo.patch
new file mode 100644
index 0000000000..5caaa438ea
--- /dev/null
+++ b/patches.suse/0009-btrfs-qgroup-Don-t-scan-leaf-if-we-re-modifying-relo.patch
@@ -0,0 +1,68 @@
+From c4140cbf35b90422be6589024f47e132eb2298b1 Mon Sep 17 00:00:00 2001
+From: Qu Wenruo <wqu@suse.com>
+Date: Thu, 4 Apr 2019 14:45:37 +0800
+Git-commit: c4140cbf35b90422be6589024f47e132eb2298b1
+References: bsc#1063638 bsc#1128052 bsc#1108838
+Patch-mainline: v5.2-rc1
+Subject: [PATCH 9/9] btrfs: qgroup: Don't scan leaf if we're modifying reloc
+ tree
+
+Since reloc tree doesn't contribute to qgroup numbers, just skip them.
+
+This should catch the final cause of unnecessary data ref processing
+when running balance of metadata with qgroups on.
+
+The 4G data 16 snapshots test (*) should explain it pretty well:
+
+ | delayed subtree | refactor delayed ref | this patch
+---------------------------------------------------------------------
+relocated | 22653 | 22673 | 22744
+qgroup dirty | 122792 | 48360 | 70
+time | 24.494 | 11.606 | 3.944
+
+Finally, we're at the stage where qgroup + metadata balance cost no
+obvious overhead.
+
+Test environment:
+
+Test VM:
+- vRAM 8G
+- vCPU 8
+- block dev vitrio-blk, 'unsafe' cache mode
+- host block 850evo
+
+Test workload:
+- Copy 4G data from /usr/ to one subvolume
+- Create 16 snapshots of that subvolume, and modify 3 files in each
+ snapshot
+- Enable quota, rescan
+- Time "btrfs balance start -m"
+
+Signed-off-by: Qu Wenruo <wqu@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+---
+ fs/btrfs/extent-tree.c | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
+
+--- a/fs/btrfs/extent-tree.c
++++ b/fs/btrfs/extent-tree.c
+@@ -8911,11 +8911,14 @@ static noinline int walk_up_proc(struct
+ else
+ ret = btrfs_dec_ref(trans, root, eb, 0);
+ BUG_ON(ret); /* -ENOMEM */
+- ret = btrfs_qgroup_trace_leaf_items(trans, fs_info, eb);
+- if (ret) {
+- btrfs_err_rl(fs_info,
+- "error %d accounting leaf items. Quota is out of sync, rescan required.",
+- ret);
++ if (is_fstree(root->root_key.objectid)) {
++ ret = btrfs_qgroup_trace_leaf_items(trans,
++ fs_info, eb);
++ if (ret) {
++ btrfs_err_rl(fs_info,
++"error %d accounting leaf items. Quota is out of sync, rescan required.",
++ ret);
++ }
+ }
+ }
+ /* make block locked assertion in clean_tree_block happy */
diff --git a/series.conf b/series.conf
index 34685d7bb2..c0432a1338 100644
--- a/series.conf
+++ b/series.conf
@@ -21792,6 +21792,7 @@
patches.suse/0006-btrfs-extent-tree-Use-btrfs_ref-to-refactor-add_pinn.patch
patches.suse/0007-btrfs-extent-tree-Use-btrfs_ref-to-refactor-btrfs_in.patch
patches.suse/0008-btrfs-extent-tree-Use-btrfs_ref-to-refactor-btrfs_fr.patch
+ patches.suse/0009-btrfs-qgroup-Don-t-scan-leaf-if-we-re-modifying-relo.patch
patches.drivers/mmc-core-fix-possible-use-after-free-of-host.patch
patches.drivers/phy-sun4i-usb-Make-sure-to-disable-PHY0-passby-for-p.patch
patches.drivers/stm-class-Fix-channel-free-in-stm-output-free-path.patch