From 8fcdf81418f16ef878de7a7535e90599e396fd69 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Mon, 27 Feb 2023 22:58:01 -0500 Subject: 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 --- fs/bcachefs/move_types.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'fs/bcachefs/move_types.h') diff --git a/fs/bcachefs/move_types.h b/fs/bcachefs/move_types.h index 9df6d18137a5..285ffdb762ac 100644 --- a/fs/bcachefs/move_types.h +++ b/fs/bcachefs/move_types.h @@ -16,4 +16,10 @@ struct bch_move_stats { atomic64_t sectors_raced; }; +struct move_bucket_in_flight { + struct bpos bucket; + u8 gen; + atomic_t count; +}; + #endif /* _BCACHEFS_MOVE_TYPES_H */ -- cgit v1.2.3