diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-03-18 00:42:09 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:51 -0400 |
commit | 8e3f913e2ab6ac2cb9e75a0a8635d0b44f838c33 (patch) | |
tree | 935cb6aa90e9ef93b1508be5f0c81f2f06ad8c3f /fs/bcachefs/trace.h | |
parent | a8c752bb1d93a24a0de753e209d4f4d58d65c878 (diff) | |
download | linux-stable-8e3f913e2ab6ac2cb9e75a0a8635d0b44f838c33.tar.gz linux-stable-8e3f913e2ab6ac2cb9e75a0a8635d0b44f838c33.tar.bz2 linux-stable-8e3f913e2ab6ac2cb9e75a0a8635d0b44f838c33.zip |
bcachefs: Copygc now uses backpointers
Previously, copygc needed to walk the entire extents & reflink btrees to
find extents that needed to be moved.
Now that we have backpointers, this patch implements
bch2_evacuate_bucket() in the move code, which copygc now uses for
evacuating mostly empty buckets.
Also, thanks to the new backpointers code, copygc can now move btree
nodes.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/trace.h')
-rw-r--r-- | fs/bcachefs/trace.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/fs/bcachefs/trace.h b/fs/bcachefs/trace.h index 937fd132bfd2..fabee8302afa 100644 --- a/fs/bcachefs/trace.h +++ b/fs/bcachefs/trace.h @@ -717,6 +717,37 @@ TRACE_EVENT(move_data, __entry->sectors_moved, __entry->keys_moved) ); +TRACE_EVENT(evacuate_bucket, + TP_PROTO(struct bch_fs *c, struct bpos *bucket, + unsigned sectors, unsigned bucket_size, + int ret), + TP_ARGS(c, bucket, sectors, bucket_size, ret), + + TP_STRUCT__entry( + __field(dev_t, dev ) + __field(u64, member ) + __field(u64, bucket ) + __field(u32, sectors ) + __field(u32, bucket_size ) + __field(int, ret ) + ), + + TP_fast_assign( + __entry->dev = c->dev; + __entry->member = bucket->inode; + __entry->bucket = bucket->offset; + __entry->sectors = sectors; + __entry->bucket_size = bucket_size; + __entry->ret = ret; + ), + + TP_printk("%d,%d %llu:%llu sectors %u/%u ret %i", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->member, __entry->bucket, + __entry->sectors, __entry->bucket_size, + __entry->ret) +); + TRACE_EVENT(copygc, TP_PROTO(struct bch_fs *c, u64 sectors_moved, u64 sectors_not_moved, |