summaryrefslogtreecommitdiff
path: root/fs/bcachefs/alloc_foreground.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/bcachefs/alloc_foreground.c')
-rw-r--r--fs/bcachefs/alloc_foreground.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/fs/bcachefs/alloc_foreground.c b/fs/bcachefs/alloc_foreground.c
index 174b3a745ab8..2d44ce2e11de 100644
--- a/fs/bcachefs/alloc_foreground.c
+++ b/fs/bcachefs/alloc_foreground.c
@@ -26,6 +26,7 @@
#include "error.h"
#include "io.h"
#include "journal.h"
+#include "movinggc.h"
#include "trace.h"
#include <linux/math64.h>
@@ -526,7 +527,7 @@ static struct open_bucket *bch2_bucket_alloc_trans(struct btree_trans *trans,
bool waiting = false;
again:
usage = bch2_dev_usage_read(ca);
- avail = dev_buckets_free(ca, usage,reserve);
+ avail = dev_buckets_free(ca, usage, reserve);
if (usage.d[BCH_DATA_need_discard].buckets > avail)
bch2_do_discards(c);
@@ -581,14 +582,22 @@ err:
ob = ERR_PTR(-FREELIST_EMPTY);
if (!IS_ERR(ob)) {
- trace_bucket_alloc(ca, bch2_alloc_reserves[reserve], avail,
+ trace_bucket_alloc(ca, bch2_alloc_reserves[reserve],
+ usage.d[BCH_DATA_free].buckets,
+ avail,
+ bch2_copygc_wait_amount(c),
+ c->copygc_wait - atomic64_read(&c->io_clock[WRITE].now),
buckets_seen,
skipped_open,
skipped_need_journal_commit,
skipped_nouse,
cl == NULL, PTR_ERR_OR_ZERO(ob));
} else {
- trace_bucket_alloc_fail(ca, bch2_alloc_reserves[reserve], avail,
+ trace_bucket_alloc_fail(ca, bch2_alloc_reserves[reserve],
+ usage.d[BCH_DATA_free].buckets,
+ avail,
+ bch2_copygc_wait_amount(c),
+ c->copygc_wait - atomic64_read(&c->io_clock[WRITE].now),
buckets_seen,
skipped_open,
skipped_need_journal_commit,