From f25d8215f499418c17dfde0b3158a66e03c758dc Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sun, 9 Jan 2022 20:48:31 -0500 Subject: bcachefs: Kill allocator threads & freelists Now that we have new persistent data structures for the allocator, this patch converts the allocator to use them. Now, foreground bucket allocation uses the freespace btree to find buckets to allocate, instead of popping buckets off the freelist. The background allocator threads are no longer needed and are deleted, as well as the allocator freelists. Now we only need background tasks for invalidating buckets containing cached data (when we are low on empty buckets), and for issuing discards. Signed-off-by: Kent Overstreet --- fs/bcachefs/btree_gc.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'fs/bcachefs/btree_gc.c') diff --git a/fs/bcachefs/btree_gc.c b/fs/bcachefs/btree_gc.c index c3d6c62ef062..7078b277e23b 100644 --- a/fs/bcachefs/btree_gc.c +++ b/fs/bcachefs/btree_gc.c @@ -1684,9 +1684,8 @@ static void bch2_gc_stripes_reset(struct bch_fs *c, bool metadata_only) */ int bch2_gc(struct bch_fs *c, bool initial, bool metadata_only) { - struct bch_dev *ca; u64 start_time = local_clock(); - unsigned i, iter = 0; + unsigned iter = 0; int ret; lockdep_assert_held(&c->state_lock); @@ -1787,13 +1786,6 @@ out: trace_gc_end(c); bch2_time_stats_update(&c->times[BCH_TIME_btree_gc], start_time); - /* - * Wake up allocator in case it was waiting for buckets - * because of not being able to inc gens - */ - for_each_member_device(ca, c, i) - bch2_wake_allocator(ca); - /* * At startup, allocations can happen directly instead of via the * allocator thread - issue wakeup in case they blocked on gc_lock: -- cgit