Commit 6d5c606c authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: use track_event_change() for allocator blocked stats

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent ef23397c
...@@ -239,9 +239,8 @@ static struct open_bucket *__try_alloc_bucket(struct bch_fs *c, struct bch_dev * ...@@ -239,9 +239,8 @@ static struct open_bucket *__try_alloc_bucket(struct bch_fs *c, struct bch_dev *
if (cl) if (cl)
closure_wait(&c->open_buckets_wait, cl); closure_wait(&c->open_buckets_wait, cl);
if (!c->blocked_allocate_open_bucket) track_event_change(&c->times[BCH_TIME_blocked_allocate_open_bucket],
c->blocked_allocate_open_bucket = local_clock(); &c->blocked_allocate_open_bucket, true);
spin_unlock(&c->freelist_lock); spin_unlock(&c->freelist_lock);
return ERR_PTR(-BCH_ERR_open_buckets_empty); return ERR_PTR(-BCH_ERR_open_buckets_empty);
} }
...@@ -267,19 +266,11 @@ static struct open_bucket *__try_alloc_bucket(struct bch_fs *c, struct bch_dev * ...@@ -267,19 +266,11 @@ static struct open_bucket *__try_alloc_bucket(struct bch_fs *c, struct bch_dev *
ca->nr_open_buckets++; ca->nr_open_buckets++;
bch2_open_bucket_hash_add(c, ob); bch2_open_bucket_hash_add(c, ob);
if (c->blocked_allocate_open_bucket) { track_event_change(&c->times[BCH_TIME_blocked_allocate_open_bucket],
bch2_time_stats_update( &c->blocked_allocate_open_bucket, false);
&c->times[BCH_TIME_blocked_allocate_open_bucket],
c->blocked_allocate_open_bucket);
c->blocked_allocate_open_bucket = 0;
}
if (c->blocked_allocate) { track_event_change(&c->times[BCH_TIME_blocked_allocate],
bch2_time_stats_update( &c->blocked_allocate, false);
&c->times[BCH_TIME_blocked_allocate],
c->blocked_allocate);
c->blocked_allocate = 0;
}
spin_unlock(&c->freelist_lock); spin_unlock(&c->freelist_lock);
return ob; return ob;
...@@ -567,8 +558,8 @@ static struct open_bucket *bch2_bucket_alloc_trans(struct btree_trans *trans, ...@@ -567,8 +558,8 @@ static struct open_bucket *bch2_bucket_alloc_trans(struct btree_trans *trans,
goto again; goto again;
} }
if (!c->blocked_allocate) track_event_change(&c->times[BCH_TIME_blocked_allocate],
c->blocked_allocate = local_clock(); &c->blocked_allocate, true);
ob = ERR_PTR(-BCH_ERR_freelist_empty); ob = ERR_PTR(-BCH_ERR_freelist_empty);
goto err; goto err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment