diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-06-15 15:10:54 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:41 -0400 |
commit | 451570a5bc5f72c4c6442631d158f0c11cb3daa8 (patch) | |
tree | 2074e87c258941bc52261f4400ebd2ed65945e81 /fs/bcachefs/sysfs.c | |
parent | 1ada160618d66bc57beacb4c35f13e9a4c269afa (diff) | |
download | lwn-451570a5bc5f72c4c6442631d158f0c11cb3daa8.tar.gz lwn-451570a5bc5f72c4c6442631d158f0c11cb3daa8.zip |
bcachefs: Implement a new gc that only recalcs oldest gen
Full mark and sweep gc doesn't (yet?) work with the new btree key cache
code, but it also blocks updates to interior btree nodes for the
duration and isn't really necessary in practice; we aren't currently
attempting to repair errors in allocation info at runtime.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/sysfs.c')
-rw-r--r-- | fs/bcachefs/sysfs.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/bcachefs/sysfs.c b/fs/bcachefs/sysfs.c index 663b59e78824..1800e0f7f81e 100644 --- a/fs/bcachefs/sysfs.c +++ b/fs/bcachefs/sysfs.c @@ -486,9 +486,16 @@ STORE(bch2_fs) bch2_coalesce(c); if (attr == &sysfs_trigger_gc) { + /* + * Full gc is currently incompatible with btree key cache: + */ +#if 0 down_read(&c->state_lock); bch2_gc(c, NULL, false, false); up_read(&c->state_lock); +#else + bch2_gc_gens(c); +#endif } if (attr == &sysfs_trigger_alloc_write) { |