Commit adf16c6d authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: bucket_alloc_fail tracepoint should only fire when we have to block

We don't want to fire the bucket_alloc_fail tracepoint on transaction
restart, when we can retry immediately - only when we the allocation
actually has to block.

Also, switch from sched_clock() to local_clock(), as we've been doing
elsewhere.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 307e3c13
...@@ -561,7 +561,7 @@ static struct open_bucket *bch2_bucket_alloc_trans(struct btree_trans *trans, ...@@ -561,7 +561,7 @@ static struct open_bucket *bch2_bucket_alloc_trans(struct btree_trans *trans,
&s, &s,
cl == NULL, cl == NULL,
""); "");
else else if (!bch2_err_matches(PTR_ERR(ob), BCH_ERR_transaction_restart))
trace_and_count(c, bucket_alloc_fail, ca, trace_and_count(c, bucket_alloc_fail, ca,
bch2_alloc_reserves[reserve], bch2_alloc_reserves[reserve],
may_alloc_partial, may_alloc_partial,
...@@ -1093,7 +1093,7 @@ static struct write_point *writepoint_find(struct btree_trans *trans, ...@@ -1093,7 +1093,7 @@ static struct write_point *writepoint_find(struct btree_trans *trans,
hlist_add_head_rcu(&wp->node, head); hlist_add_head_rcu(&wp->node, head);
mutex_unlock(&c->write_points_hash_lock); mutex_unlock(&c->write_points_hash_lock);
out: out:
wp->last_used = sched_clock(); wp->last_used = local_clock();
return wp; return wp;
} }
...@@ -1341,7 +1341,7 @@ void bch2_fs_allocator_foreground_init(struct bch_fs *c) ...@@ -1341,7 +1341,7 @@ void bch2_fs_allocator_foreground_init(struct bch_fs *c)
wp < c->write_points + c->write_points_nr; wp++) { wp < c->write_points + c->write_points_nr; wp++) {
writepoint_init(wp, BCH_DATA_user); writepoint_init(wp, BCH_DATA_user);
wp->last_used = sched_clock(); wp->last_used = local_clock();
wp->write_point = (unsigned long) wp; wp->write_point = (unsigned long) wp;
hlist_add_head_rcu(&wp->node, hlist_add_head_rcu(&wp->node,
writepoint_hash(c, wp->write_point)); writepoint_hash(c, wp->write_point));
......
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