mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 00:34:20 +08:00
bcachefs: Rip out old hacky transaction restart tracing
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
20bceecb31
commit
61011ea237
@ -731,7 +731,6 @@ retry:
|
||||
if (bch2_btree_node_relock(iter, level + 1))
|
||||
goto retry;
|
||||
|
||||
trans_restart();
|
||||
trace_trans_restart_btree_node_reused(iter->trans->ip);
|
||||
return ERR_PTR(-EINTR);
|
||||
}
|
||||
|
@ -269,7 +269,6 @@ bool __bch2_btree_node_lock(struct btree *b, struct bpos pos,
|
||||
}
|
||||
|
||||
if (unlikely(!ret)) {
|
||||
trans_restart();
|
||||
trace_trans_restart_would_deadlock(iter->trans->ip);
|
||||
return false;
|
||||
}
|
||||
@ -1713,7 +1712,6 @@ success:
|
||||
trans->size = new_size;
|
||||
|
||||
if (trans->iters_live) {
|
||||
trans_restart();
|
||||
trace_trans_restart_iters_realloced(trans->ip, trans->size);
|
||||
return -EINTR;
|
||||
}
|
||||
@ -1874,7 +1872,6 @@ static int bch2_trans_preload_mem(struct btree_trans *trans, size_t size)
|
||||
trans->mem_bytes = new_bytes;
|
||||
|
||||
if (old_bytes) {
|
||||
trans_restart();
|
||||
trace_trans_restart_mem_realloced(trans->ip, new_bytes);
|
||||
return -EINTR;
|
||||
}
|
||||
@ -1910,7 +1907,7 @@ inline void bch2_trans_unlink_iters(struct btree_trans *trans, u64 iters)
|
||||
}
|
||||
}
|
||||
|
||||
void __bch2_trans_begin(struct btree_trans *trans)
|
||||
void bch2_trans_begin(struct btree_trans *trans)
|
||||
{
|
||||
u64 iters_to_unlink;
|
||||
|
||||
|
@ -292,7 +292,7 @@ struct btree_iter *bch2_trans_get_node_iter(struct btree_trans *,
|
||||
enum btree_id, struct bpos,
|
||||
unsigned, unsigned, unsigned);
|
||||
|
||||
void __bch2_trans_begin(struct btree_trans *);
|
||||
void bch2_trans_begin(struct btree_trans *);
|
||||
|
||||
static inline void bch2_trans_begin_updates(struct btree_trans *trans)
|
||||
{
|
||||
@ -303,24 +303,4 @@ void *bch2_trans_kmalloc(struct btree_trans *, size_t);
|
||||
void bch2_trans_init(struct btree_trans *, struct bch_fs *, unsigned, size_t);
|
||||
int bch2_trans_exit(struct btree_trans *);
|
||||
|
||||
#ifdef TRACE_TRANSACTION_RESTARTS
|
||||
#define bch2_trans_begin(_trans) \
|
||||
do { \
|
||||
if (is_power_of_2((_trans)->nr_restarts) && \
|
||||
(_trans)->nr_restarts >= 8) \
|
||||
pr_info("nr restarts: %zu", (_trans)->nr_restarts); \
|
||||
\
|
||||
(_trans)->nr_restarts++; \
|
||||
__bch2_trans_begin(_trans); \
|
||||
} while (0)
|
||||
#else
|
||||
#define bch2_trans_begin(_trans) __bch2_trans_begin(_trans)
|
||||
#endif
|
||||
|
||||
#ifdef TRACE_TRANSACTION_RESTARTS_ALL
|
||||
#define trans_restart(...) pr_info("transaction restart" __VA_ARGS__)
|
||||
#else
|
||||
#define trans_restart(...) no_printk("transaction restart" __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#endif /* _BCACHEFS_BTREE_ITER_H */
|
||||
|
@ -272,7 +272,6 @@ struct btree_insert_entry {
|
||||
struct btree_trans {
|
||||
struct bch_fs *c;
|
||||
unsigned long ip;
|
||||
size_t nr_restarts;
|
||||
u64 commit_start;
|
||||
|
||||
u64 iters_linked;
|
||||
|
@ -439,7 +439,6 @@ static int bch2_trans_journal_preres_get(struct btree_trans *trans)
|
||||
return ret;
|
||||
|
||||
if (!bch2_trans_relock(trans)) {
|
||||
trans_restart(" (iter relock after journal preres get blocked)");
|
||||
trace_trans_restart_journal_preres_get(trans->ip);
|
||||
return -EINTR;
|
||||
}
|
||||
@ -569,7 +568,6 @@ static inline int do_btree_insert_at(struct btree_trans *trans,
|
||||
|
||||
if (race_fault()) {
|
||||
ret = -EINTR;
|
||||
trans_restart(" (race)");
|
||||
trace_trans_restart_fault_inject(trans->ip);
|
||||
goto out;
|
||||
}
|
||||
@ -718,7 +716,6 @@ int bch2_trans_commit_error(struct btree_trans *trans,
|
||||
if (!ret ||
|
||||
ret == -EINTR ||
|
||||
(flags & BTREE_INSERT_NOUNLOCK)) {
|
||||
trans_restart(" (split)");
|
||||
trace_trans_restart_btree_node_split(trans->ip);
|
||||
ret = -EINTR;
|
||||
}
|
||||
@ -738,7 +735,6 @@ int bch2_trans_commit_error(struct btree_trans *trans,
|
||||
if (bch2_trans_relock(trans))
|
||||
return 0;
|
||||
|
||||
trans_restart(" (iter relock after marking replicas)");
|
||||
trace_trans_restart_mark_replicas(trans->ip);
|
||||
ret = -EINTR;
|
||||
break;
|
||||
@ -752,7 +748,6 @@ int bch2_trans_commit_error(struct btree_trans *trans,
|
||||
if (bch2_trans_relock(trans))
|
||||
return 0;
|
||||
|
||||
trans_restart(" (iter relock after journal res get blocked)");
|
||||
trace_trans_restart_journal_res_get(trans->ip);
|
||||
ret = -EINTR;
|
||||
break;
|
||||
@ -765,7 +760,6 @@ int bch2_trans_commit_error(struct btree_trans *trans,
|
||||
int ret2 = bch2_btree_iter_traverse_all(trans);
|
||||
|
||||
if (ret2) {
|
||||
trans_restart(" (traverse)");
|
||||
trace_trans_restart_traverse(trans->ip);
|
||||
return ret2;
|
||||
}
|
||||
@ -777,7 +771,6 @@ int bch2_trans_commit_error(struct btree_trans *trans,
|
||||
if (!(flags & BTREE_INSERT_ATOMIC))
|
||||
return 0;
|
||||
|
||||
trans_restart(" (atomic)");
|
||||
trace_trans_restart_atomic(trans->ip);
|
||||
}
|
||||
|
||||
@ -803,12 +796,7 @@ static int __bch2_trans_commit(struct btree_trans *trans,
|
||||
int ret;
|
||||
|
||||
trans_for_each_update_iter(trans, i) {
|
||||
unsigned old_locks_want = i->iter->locks_want;
|
||||
unsigned old_uptodate = i->iter->uptodate;
|
||||
|
||||
if (!bch2_btree_iter_upgrade(i->iter, 1)) {
|
||||
trans_restart(" (failed upgrade, locks_want %u uptodate %u)",
|
||||
old_locks_want, old_uptodate);
|
||||
trace_trans_restart_upgrade(trans->ip);
|
||||
ret = -EINTR;
|
||||
goto err;
|
||||
|
Loading…
Reference in New Issue
Block a user