]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: track discardable extents for async discard
authorDennis Zhou <dennis@kernel.org>
Sat, 14 Dec 2019 00:22:20 +0000 (16:22 -0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 20 Jan 2020 15:40:58 +0000 (16:40 +0100)
commite114729ef7fdb26f6db94d2f0d14e370e0c02b84
tree9f21dfa02d5a64a860e4cc392b534c2720785950
parent57ea96560219ffb1ef77aaafdcd5039f8c8d7dc1
btrfs: track discardable extents for async discard

The number of discardable extents will serve as the rate limiting metric
for how often we should discard. This keeps track of discardable extents
in the free space caches by maintaining deltas and propagating them to
the global count.

The deltas are calculated from 2 values stored in PREV and CURR entries,
then propagated up to the global discard ctl.  The current counter value
becomes the previous counter value after update.

Signed-off-by: Dennis Zhou <dennis@kernel.org>
Reviewed-by: David Sterba <dsterba@suse.com>
[ update changelog ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/discard.c
fs/btrfs/discard.h
fs/btrfs/free-space-cache.c
fs/btrfs/free-space-cache.h
fs/btrfs/sysfs.c