summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2016-03-04 16:47:34 -0900
committerKent Overstreet <kent.overstreet@gmail.com>2016-08-28 19:16:14 -0800
commita011e80ba5aab3688ec2375abade36f660054c98 (patch)
tree4b218587d4755cabbcfadf310c602ffcf0f076c9
parent68fea09902e5833893a95c42b5437b1c964250ee (diff)
bcache gc debug code
-rw-r--r--fs/bcachefs/btree_gc.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/bcachefs/btree_gc.c b/fs/bcachefs/btree_gc.c
index 5e3cb929c8cf..532248778534 100644
--- a/fs/bcachefs/btree_gc.c
+++ b/fs/bcachefs/btree_gc.c
@@ -422,6 +422,22 @@ void bch_gc(struct cache_set *c)
for_each_cache(ca, c, i)
atomic_long_set(&ca->saturated_count, 0);
+ if (1) {
+ struct bucket_stats_cache_set old = c->bucket_stats_cached;
+ struct bucket_stats_cache_set new =
+ __bch_bucket_stats_read_cache_set(c);
+
+ pr_info("\n"
+ "before: meta %llu dirty %llu reserved %llu\n"
+ "after: meta %llu dirty %llu reserved %llu\n",
+ old.sectors_meta,
+ old.sectors_dirty,
+ old.sectors_persistent_reserved,
+ new.sectors_meta,
+ new.sectors_dirty,
+ new.sectors_persistent_reserved);
+ }
+
/* Indicates that gc is no longer in progress: */
gc_pos_set(c, gc_phase(GC_PHASE_DONE));