bcache: Allocator cleanup/fixes
The main fix is that bch_allocator_thread() wasn't waiting on
garbage collection to finish (if invalidate_buckets had set
ca->invalidate_needs_gc); we need that to make sure the allocator
doesn't spin and potentially block gc from finishing.
Signed-off-by: Kent Overstreet <koverstreet@google.com>
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index 8523407..7a5658f 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -984,7 +984,7 @@
if (b->prio_blocked &&
!atomic_sub_return(b->prio_blocked, &b->c->prio_blocked))
- closure_wake_up(&b->c->bucket_wait);
+ wake_up(&b->c->alloc_wait);
b->prio_blocked = 0;
@@ -1548,7 +1548,6 @@
trace_bcache_gc_end(c->sb.set_uuid);
wake_up(&c->alloc_wait);
- closure_wake_up(&c->bucket_wait);
continue_at(cl, bch_moving_gc, bch_gc_wq);
}