• Filipe Manana's avatar
    btrfs: add a global per cpu counter to track number of used extent maps · f1d97e76
    Filipe Manana authored
    Add a per cpu counter that tracks the total number of extent maps that are
    in extent trees of inodes that belong to fs trees. This is going to be
    used in an upcoming change that adds a shrinker for extent maps. Only
    extent maps for fs trees are considered, because for special trees such as
    the data relocation tree we don't want to evict their extent maps which
    are critical for the relocation to work, and since those are limited, it's
    not a concern to have them in memory during the relocation of a block
    group. Another case are extent maps for free space cache inodes, which
    must always remain in memory, but those are limited (there's only one per
    free space cache inode, which means one per block group).
    Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    f1d97e76
fs.h 31 KB