kernel_optimize_test/fs/btrfs
Qu Wenruo 3d0174f78e btrfs: qgroup: Only trace data extents in leaves if we're relocating data block group
For qgroup_trace_extent_swap(), if we find one leaf that needs to be
traced, we will also iterate all file extents and trace them.

This is OK if we're relocating data block groups, but if we're
relocating metadata block groups, balance code itself has ensured that
both subtree of file tree and reloc tree contain the same contents.

That's to say, if we're relocating metadata block groups, all file
extents in reloc and file tree should match, thus no need to trace them.
This should reduce the total number of dirty extents processed in metadata
block group balance.

[[Benchmark]] (with all previous enhancement)
Hardware:
	VM 4G vRAM, 8 vCPUs,
	disk is using 'unsafe' cache mode,
	backing device is SAMSUNG 850 evo SSD.
	Host has 16G ram.

Mkfs parameter:
	--nodesize 4K (To bump up tree size)

Initial subvolume contents:
	4G data copied from /usr and /lib.
	(With enough regular small files)

Snapshots:
	16 snapshots of the original subvolume.
	each snapshot has 3 random files modified.

balance parameter:
	-m

So the content should be pretty similar to a real world root fs layout.

                     | v4.19-rc1    | w/ patchset    | diff (*)
---------------------------------------------------------------
relocated extents    | 22929        | 22851          | -0.3%
qgroup dirty extents | 227757       | 140886         | -38.1%
time (sys)           | 65.253s      | 37.464s        | -42.6%
time (real)          | 74.032s      | 44.722s        | -39.6%

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-10-15 17:23:36 +02:00
..
tests btrfs: tests: add separate stub for find_lock_delalloc_range 2018-10-15 17:23:34 +02:00
acl.c btrfs: remove unnecessary curly braces in btrfs_get_acl 2018-08-06 13:12:41 +02:00
async-thread.c
async-thread.h
backref.c Btrfs: preftree: use rb_first_cached 2018-10-15 17:23:33 +02:00
backref.h
btrfs_inode.h btrfs: Remove 'objectid' member from struct btrfs_root 2018-10-15 17:23:25 +02:00
check-integrity.c Btrfs: use args in the correct order for kcalloc in btrfsic_read_block 2018-10-15 17:23:30 +02:00
check-integrity.h
compression.c btrfs: remove unused pointer 'tree' in btrfs_submit_compressed_read 2018-10-15 17:23:28 +02:00
compression.h
ctree.c btrfs: handle error of get_old_root 2018-10-15 17:23:31 +02:00
ctree.h btrfs: tests: polish ifdefs around testing helper 2018-10-15 17:23:34 +02:00
dedupe.h
delayed-inode.c Btrfs: delayed-inode: use rb_first_cached for ins_root and del_root 2018-10-15 17:23:33 +02:00
delayed-inode.h Btrfs: delayed-inode: use rb_first_cached for ins_root and del_root 2018-10-15 17:23:33 +02:00
delayed-ref.c Btrfs: delayed-refs: use rb_first_cached for ref_tree 2018-10-15 17:23:33 +02:00
delayed-ref.h Btrfs: delayed-refs: use rb_first_cached for ref_tree 2018-10-15 17:23:33 +02:00
dev-replace.c btrfs: fix error handling in btrfs_dev_replace_start 2018-10-15 17:23:31 +02:00
dev-replace.h
dir-item.c btrfs: Remove root parameter from btrfs_insert_dir_item 2018-10-15 17:23:25 +02:00
disk-io.c Btrfs: delayed-refs: use rb_first_cached for ref_tree 2018-10-15 17:23:33 +02:00
disk-io.h btrfs: unify end_io callbacks of async_submit_bio 2018-08-06 13:12:55 +02:00
export.c btrfs: Remove 'objectid' member from struct btrfs_root 2018-10-15 17:23:25 +02:00
export.h
extent_io.c btrfs: tests: add separate stub for find_lock_delalloc_range 2018-10-15 17:23:34 +02:00
extent_io.h btrfs: tests: add separate stub for find_lock_delalloc_range 2018-10-15 17:23:34 +02:00
extent_map.c Btrfs: extent_map: use rb_first_cached 2018-10-15 17:23:33 +02:00
extent_map.h Btrfs: extent_map: use rb_first_cached 2018-10-15 17:23:33 +02:00
extent-tree.c btrfs: qgroup: Don't trace subtree if we're dropping reloc tree 2018-10-15 17:23:36 +02:00
file-item.c btrfs: simplify pointer chasing of local fs_info variables 2018-08-06 13:12:43 +02:00
file.c Btrfs: don't clean dirty pages during buffered writes 2018-10-15 17:23:35 +02:00
free-space-cache.c btrfs: remove unneeded NULL checks before kfree 2018-10-15 17:23:26 +02:00
free-space-cache.h
free-space-tree.c btrfs: Remove fs_info from btrfs_del_root 2018-08-06 13:13:00 +02:00
free-space-tree.h
inode-item.c
inode-map.c btrfs: prune unused includes 2018-08-06 13:12:43 +02:00
inode-map.h
inode.c Btrfs: get rid of btrfs_symlink_aops 2018-10-15 17:23:35 +02:00
ioctl.c btrfs: Ensure btrfs_trim_fs can trim the whole filesystem 2018-10-15 17:23:32 +02:00
Kconfig
locking.c
locking.h
lzo.c
Makefile
math.h
ordered-data.c btrfs: prune unused includes 2018-08-06 13:12:43 +02:00
ordered-data.h btrfs: remove remaing full_sync logic from btrfs_sync_file 2018-08-06 13:12:31 +02:00
orphan.c
print-tree.c btrfs: annotate unlikely branches after V0 extent type removal 2018-08-06 13:12:41 +02:00
print-tree.h
props.c
props.h
qgroup.c btrfs: qgroup: Only trace data extents in leaves if we're relocating data block group 2018-10-15 17:23:36 +02:00
qgroup.h btrfs: qgroup: Only trace data extents in leaves if we're relocating data block group 2018-10-15 17:23:36 +02:00
raid56.c btrfs: raid56: catch errors from full_stripe_write 2018-08-06 13:12:45 +02:00
raid56.h
rcu-string.h
reada.c btrfs: prune unused includes 2018-08-06 13:12:43 +02:00
ref-verify.c btrfs: Remove 'objectid' member from struct btrfs_root 2018-10-15 17:23:25 +02:00
ref-verify.h
relocation.c btrfs: qgroup: Only trace data extents in leaves if we're relocating data block group 2018-10-15 17:23:36 +02:00
root-tree.c btrfs: Remove fs_info from btrfs_add_root_ref 2018-08-06 13:13:00 +02:00
scrub.c Btrfs: clean up scrub is_dev_replace parameter 2018-10-15 17:23:26 +02:00
send.c Btrfs: unify error handling of btrfs_lookup_dir_item 2018-10-15 17:23:30 +02:00
send.h
struct-funcs.c btrfs: prune unused includes 2018-08-06 13:12:43 +02:00
super.c btrfs: Remove 'objectid' member from struct btrfs_root 2018-10-15 17:23:25 +02:00
sysfs.c btrfs: prune unused includes 2018-08-06 13:12:43 +02:00
sysfs.h
transaction.c Btrfs: delayed-refs: use rb_first_cached for href_root 2018-10-15 17:23:33 +02:00
transaction.h btrfs: replace get_seconds with new 64bit time API 2018-08-06 13:12:29 +02:00
tree-checker.c btrfs: tree-checker: Detect invalid and empty essential trees 2018-08-06 13:12:42 +02:00
tree-checker.h
tree-defrag.c
tree-log.c btrfs: fix error handling in free_log_tree 2018-10-15 17:23:29 +02:00
tree-log.h btrfs: change btrfs_pin_log_trans to return void 2018-10-15 17:23:27 +02:00
ulist.c
ulist.h
uuid-tree.c
volumes.c btrfs: use common helper instead of open coding a bit test 2018-10-15 17:23:35 +02:00
volumes.h btrfs: Make btrfs_find_device_by_devspec return btrfs_device directly 2018-10-15 17:23:30 +02:00
xattr.c
xattr.h
zlib.c
zstd.c