diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-08-01 21:26:55 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:08:08 +0300 |
commit | a9bec5208b4379c87fa8361f813cb71b5581540e (patch) | |
tree | 39fce8b6b2c1d649b07e198d25a94b476ee1a668 /fs/bcachefs/movinggc.c | |
parent | 6eac2c2e2440280ca551d4936807a8a130970469 (diff) | |
download | linux-a9bec5208b4379c87fa8361f813cb71b5581540e.tar.xz |
bcachefs: Better calculation of copygc threshold
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/movinggc.c')
-rw-r--r-- | fs/bcachefs/movinggc.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/fs/bcachefs/movinggc.c b/fs/bcachefs/movinggc.c index 8b61b163faf5..26b8e95db1db 100644 --- a/fs/bcachefs/movinggc.c +++ b/fs/bcachefs/movinggc.c @@ -228,16 +228,10 @@ static int bch2_copygc_thread(void *arg) last = atomic_long_read(&clock->now); - reserve = div64_u64((ca->mi.nbuckets - ca->mi.first_bucket) * - ca->mi.bucket_size * - c->opts.gc_reserve_percent, 200); + reserve = ca->copygc_threshold; usage = bch2_dev_usage_read(c, ca); - /* - * don't start copygc until less than half the gc reserve is - * available: - */ available = __dev_buckets_available(ca, usage) * ca->mi.bucket_size; if (available > reserve) { |