]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: limit max discard size for async discard
authorDennis Zhou <dennis@kernel.org>
Thu, 2 Jan 2020 21:26:37 +0000 (16:26 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 20 Jan 2020 15:40:59 +0000 (16:40 +0100)
commit9064fa2e9250fcc37d3935f5d9e2724ea0c4ead0
tree77badf26527c9d58896c8d14f3f906109aff668d
parentdcea4bb7ce36b8e88f79aa7b8ef009dad1773f31
btrfs: limit max discard size for async discard

Throttle the maximum size of a discard so that we can provide an upper
bound for the rate of async discard. While the block layer is able to
split discards into the appropriate sized discards, we want to be able
to account more accurately the rate at which we are consuming NCQ slots
as well as limit the upper bound of work for a discard.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Dennis Zhou <dennis@kernel.org>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/discard.h
fs/btrfs/free-space-cache.c