Skip to content

Commit a1f0358

Browse files
author
Kent Overstreet
committed
bcache: Incremental gc
Big garbage collection rewrite; now, garbage collection uses the same mechanisms as used elsewhere for inserting/updating btree node pointers, instead of rewriting interior btree nodes in place. This makes the code significantly cleaner and less fragile, and means we can now make garbage collection incremental - it doesn't have to hold a write lock on the root of the btree for the entire duration of garbage collection. This means that there's less of a latency hit for doing garbage collection, which means we can gc more frequently (and do a better job of reclaiming from the cache), and we can coalesce across more btree nodes (improving our space efficiency). Signed-off-by: Kent Overstreet <kmo@daterainc.com>
1 parent 8835c12 commit a1f0358

4 files changed

Lines changed: 226 additions & 167 deletions

File tree

‎drivers/md/bcache/bcache.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,6 @@ struct gc_stat {
477477

478478
size_t nkeys;
479479
uint64_t data; /* sectors */
480-
uint64_t dirty; /* sectors */
481480
unsigned in_use; /* percent */
482481
};
483482

0 commit comments

Comments
 (0)