summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/move.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-02-27 22:58:01 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:56 -0400
commit8fcdf81418f16ef878de7a7535e90599e396fd69 (patch)
tree1bbef7695558d893d8000d486c9b8e8006f19776 /fs/bcachefs/move.h
parent0b943b973c67c2780cb991c3011ad3279f670fa4 (diff)
downloadlinux-8fcdf81418f16ef878de7a7535e90599e396fd69.tar.gz
linux-8fcdf81418f16ef878de7a7535e90599e396fd69.tar.bz2
linux-8fcdf81418f16ef878de7a7535e90599e396fd69.zip
bcachefs: Improved copygc pipelining
This improves copygc pipelining across multiple buckets: we now track each in flight bucket we're evacuating, with separate moving_contexts. This means that whereas previously we had to wait for outstanding moves to complete to ensure we didn't try to evacuate the same bucket twice, we can now just check buckets we want to evacuate against the pending list. This also mean we can run the verify_bucket_evacuated() check without killing pipelining - meaning it can now always be enabled, not just on debug builds. This is going to be important for the upcoming erasure coding work, where moving IOs that are being erasure coded will now skip the initial replication step; instead the IOs will wait on the stripe to complete. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/move.h')
-rw-r--r--fs/bcachefs/move.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/bcachefs/move.h b/fs/bcachefs/move.h
index c5a7c0add1d6..4c0013872347 100644
--- a/fs/bcachefs/move.h
+++ b/fs/bcachefs/move.h
@@ -30,6 +30,8 @@ struct moving_context {
wait_queue_head_t wait;
};
+void bch2_verify_bucket_evacuated(struct btree_trans *, struct bpos, int);
+
#define move_ctxt_wait_event(_ctxt, _trans, _cond) \
do { \
bool cond_finished = false; \
@@ -68,6 +70,7 @@ int bch2_move_data(struct bch_fs *,
int __bch2_evacuate_bucket(struct btree_trans *,
struct moving_context *,
+ struct move_bucket_in_flight *,
struct bpos, int,
struct data_update_opts);
int bch2_evacuate_bucket(struct bch_fs *, struct bpos, int,