summaryrefslogtreecommitdiff
path: root/libbcachefs/alloc.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-02-28 17:56:28 -0500
committerKent Overstreet <kent.overstreet@gmail.com>2018-02-28 17:57:55 -0500
commit1991277c8e723b018c90523949e8242692810911 (patch)
tree790b44b133642700cf692a00bc1713b86cc5564d /libbcachefs/alloc.c
parent3a6164cdebe08db9c08d171e5fce48ef7a1683b6 (diff)
Update bcachefs sources to e7f4678827 bcachefs: fix variable shadowing in macro call
Diffstat (limited to 'libbcachefs/alloc.c')
-rw-r--r--libbcachefs/alloc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libbcachefs/alloc.c b/libbcachefs/alloc.c
index a76f2b7c..470ef207 100644
--- a/libbcachefs/alloc.c
+++ b/libbcachefs/alloc.c
@@ -966,11 +966,24 @@ static int bch2_allocator_thread(void *arg)
if (fifo_full(&ca->free_inc))
break;
+ if (!fifo_empty(&ca->free_inc) &&
+ !fifo_full(&ca->free[RESERVE_MOVINGGC]))
+ break;
+
+ /*
+ * copygc may be waiting until either its reserve fills
+ * up, or we can't make forward progress:
+ */
+ ca->allocator_blocked = true;
+ closure_wake_up(&c->freelist_wait);
+
if (wait_buckets_available(c, ca)) {
up_read(&c->gc_lock);
return 0;
}
}
+
+ ca->allocator_blocked = false;
up_read(&c->gc_lock);
sort_free_inc(c, ca);