]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: do async reclaim for data reservations
authorJosef Bacik <josef@toxicpanda.com>
Tue, 21 Jul 2020 14:22:33 +0000 (10:22 -0400)
committerDavid Sterba <dsterba@suse.com>
Wed, 7 Oct 2020 10:06:54 +0000 (12:06 +0200)
commit9918e90ea418067dc486b6cdec9cf4eeae2fcb01
tree7aced5062494c92c72bbf2b8e04975805babb241
parent66407f3b535e5a6f4ba742173b82a393bc8d2d25
btrfs: do async reclaim for data reservations

Now that we have the data ticketing stuff in place, move normal data
reservations to use an async reclaim helper to satisfy tickets.  Before
we could have multiple tasks race in and both allocate chunks, resulting
in more data chunks than we would necessarily need.  Serializing these
allocations and making a single thread responsible for flushing will
only allocate chunks as needed, as well as cut down on transaction
commits and other flush related activities.

Priority reservations will still work as they have before, simply
trying to allocate a chunk until they can make their reservation.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Tested-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/space-info.c
fs/btrfs/super.c