]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: prefetch chunk tree leaves at mount
authorDavid Sterba <dsterba@suse.com>
Wed, 8 Jul 2020 20:55:14 +0000 (22:55 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 27 Jul 2020 10:55:43 +0000 (12:55 +0200)
commit63b5dcd67281bcee12f9e4fcd408d3d02005b50e
tree02578885884b3ad423e47ec7f012d3975a4d8de5
parent807e021ddd9c9fe6edc574c2ab1575bb9d8b34d0
btrfs: prefetch chunk tree leaves at mount

The whole chunk tree is read at mount time so we can utilize readahead
to get the tree blocks to memory before we read the items. The idea is
from Robbie, but instead of updating search slot readahead, this patch
implements the chunk tree readahead manually from nodes on level 1.

We've decided to do specific readahead optimizations and then unify them
under a common API so we don't break everything by changing the search
slot readahead logic.

Higher chunk trees grow on large filesystems (many terabytes), and
prefetching just level 1 seems to be sufficient. Provided example was
from a 200TiB filesystem with chunk tree level 2.

CC: Robbie Ko <robbieko@synology.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c