diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-01-10 04:48:31 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:29 +0300 |
commit | f25d8215f499418c17dfde0b3158a66e03c758dc (patch) | |
tree | 2239ac974b58f41e6687a840c21cf2156795fded /fs/bcachefs/ec.c | |
parent | c6b2826cd14c5421bc50a768e923d078a71139c1 (diff) | |
download | linux-f25d8215f499418c17dfde0b3158a66e03c758dc.tar.xz |
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 <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/ec.c')
-rw-r--r-- | fs/bcachefs/ec.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/fs/bcachefs/ec.c b/fs/bcachefs/ec.c index 9dc2f9f822c8..5030a5b831af 100644 --- a/fs/bcachefs/ec.c +++ b/fs/bcachefs/ec.c @@ -1295,9 +1295,6 @@ static int new_stripe_alloc_buckets(struct bch_fs *c, struct ec_stripe_head *h, BUG_ON(nr_have_data > h->s->nr_data); BUG_ON(nr_have_parity > h->s->nr_parity); - percpu_down_read(&c->mark_lock); - rcu_read_lock(); - buckets.nr = 0; if (nr_have_parity < h->s->nr_parity) { ret = bch2_bucket_alloc_set(c, &buckets, @@ -1324,7 +1321,7 @@ static int new_stripe_alloc_buckets(struct bch_fs *c, struct ec_stripe_head *h, } if (ret) - goto err; + return ret; } buckets.nr = 0; @@ -1352,12 +1349,10 @@ static int new_stripe_alloc_buckets(struct bch_fs *c, struct ec_stripe_head *h, } if (ret) - goto err; + return ret; } -err: - rcu_read_unlock(); - percpu_up_read(&c->mark_lock); - return ret; + + return 0; } /* XXX: doesn't obey target: */ |