summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/space-info.h
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2022-03-29 10:56:06 +0200
committerDavid Sterba <dsterba@suse.com>2022-05-16 17:03:11 +0200
commitbb5a098d9791f184899499531ff4411089e2a5e0 (patch)
tree2fd6a2374e9fcd2f10ff674a6698f0580d6a6a64 /fs/btrfs/space-info.h
parentbtrfs: do not test for free space inode during NOCOW check against file extent (diff)
downloadlinux-bb5a098d9791f184899499531ff4411089e2a5e0.tar.xz
linux-bb5a098d9791f184899499531ff4411089e2a5e0.zip
btrfs: make the bg_reclaim_threshold per-space info
For non-zoned file systems it's useful to have the auto reclaim feature, however there are different use cases for non-zoned, for example we may not want to reclaim metadata chunks ever, only data chunks. Move this sysfs flag to per-space_info. This won't affect current users because this tunable only ever did anything for zoned, and that is currently hidden behind BTRFS_CONFIG_DEBUG. Tested-by: Pankaj Raghav <p.raghav@samsung.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> [ jth restore global bg_reclaim_threshold ] Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/space-info.h')
-rw-r--r--fs/btrfs/space-info.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/space-info.h b/fs/btrfs/space-info.h
index d841fed73492..a803e29bd781 100644
--- a/fs/btrfs/space-info.h
+++ b/fs/btrfs/space-info.h
@@ -24,6 +24,12 @@ struct btrfs_space_info {
the space info if we had an ENOSPC in the
allocator. */
+ /*
+ * Once a block group drops below this threshold (percents) we'll
+ * schedule it for reclaim.
+ */
+ int bg_reclaim_threshold;
+
int clamp; /* Used to scale our threshold for preemptive
flushing. The value is >> clamp, so turns
out to be a 2^clamp divisor. */