• David Sterba's avatar
    btrfs: prefetch chunk tree leaves at mount · d85327b1
    David Sterba authored
    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: default avatarJosef Bacik <josef@toxicpanda.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    d85327b1
volumes.c 203 KB