Commit 61011ea2 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Rip out old hacky transaction restart tracing

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 20bceecb
...@@ -731,7 +731,6 @@ struct btree *bch2_btree_node_get(struct bch_fs *c, struct btree_iter *iter, ...@@ -731,7 +731,6 @@ struct btree *bch2_btree_node_get(struct bch_fs *c, struct btree_iter *iter,
if (bch2_btree_node_relock(iter, level + 1)) if (bch2_btree_node_relock(iter, level + 1))
goto retry; goto retry;
trans_restart();
trace_trans_restart_btree_node_reused(iter->trans->ip); trace_trans_restart_btree_node_reused(iter->trans->ip);
return ERR_PTR(-EINTR); return ERR_PTR(-EINTR);
} }
......
...@@ -269,7 +269,6 @@ bool __bch2_btree_node_lock(struct btree *b, struct bpos pos, ...@@ -269,7 +269,6 @@ bool __bch2_btree_node_lock(struct btree *b, struct bpos pos,
} }
if (unlikely(!ret)) { if (unlikely(!ret)) {
trans_restart();
trace_trans_restart_would_deadlock(iter->trans->ip); trace_trans_restart_would_deadlock(iter->trans->ip);
return false; return false;
} }
...@@ -1713,7 +1712,6 @@ static int bch2_trans_realloc_iters(struct btree_trans *trans, ...@@ -1713,7 +1712,6 @@ static int bch2_trans_realloc_iters(struct btree_trans *trans,
trans->size = new_size; trans->size = new_size;
if (trans->iters_live) { if (trans->iters_live) {
trans_restart();
trace_trans_restart_iters_realloced(trans->ip, trans->size); trace_trans_restart_iters_realloced(trans->ip, trans->size);
return -EINTR; return -EINTR;
} }
...@@ -1874,7 +1872,6 @@ static int bch2_trans_preload_mem(struct btree_trans *trans, size_t size) ...@@ -1874,7 +1872,6 @@ static int bch2_trans_preload_mem(struct btree_trans *trans, size_t size)
trans->mem_bytes = new_bytes; trans->mem_bytes = new_bytes;
if (old_bytes) { if (old_bytes) {
trans_restart();
trace_trans_restart_mem_realloced(trans->ip, new_bytes); trace_trans_restart_mem_realloced(trans->ip, new_bytes);
return -EINTR; return -EINTR;
} }
...@@ -1910,7 +1907,7 @@ inline void bch2_trans_unlink_iters(struct btree_trans *trans, u64 iters) ...@@ -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; u64 iters_to_unlink;
......
...@@ -292,7 +292,7 @@ struct btree_iter *bch2_trans_get_node_iter(struct btree_trans *, ...@@ -292,7 +292,7 @@ struct btree_iter *bch2_trans_get_node_iter(struct btree_trans *,
enum btree_id, struct bpos, enum btree_id, struct bpos,
unsigned, unsigned, unsigned); 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) static inline void bch2_trans_begin_updates(struct btree_trans *trans)
{ {
...@@ -303,24 +303,4 @@ void *bch2_trans_kmalloc(struct btree_trans *, size_t); ...@@ -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); void bch2_trans_init(struct btree_trans *, struct bch_fs *, unsigned, size_t);
int bch2_trans_exit(struct btree_trans *); 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 */ #endif /* _BCACHEFS_BTREE_ITER_H */
...@@ -272,7 +272,6 @@ struct btree_insert_entry { ...@@ -272,7 +272,6 @@ struct btree_insert_entry {
struct btree_trans { struct btree_trans {
struct bch_fs *c; struct bch_fs *c;
unsigned long ip; unsigned long ip;
size_t nr_restarts;
u64 commit_start; u64 commit_start;
u64 iters_linked; u64 iters_linked;
......
...@@ -439,7 +439,6 @@ static int bch2_trans_journal_preres_get(struct btree_trans *trans) ...@@ -439,7 +439,6 @@ static int bch2_trans_journal_preres_get(struct btree_trans *trans)
return ret; return ret;
if (!bch2_trans_relock(trans)) { if (!bch2_trans_relock(trans)) {
trans_restart(" (iter relock after journal preres get blocked)");
trace_trans_restart_journal_preres_get(trans->ip); trace_trans_restart_journal_preres_get(trans->ip);
return -EINTR; return -EINTR;
} }
...@@ -569,7 +568,6 @@ static inline int do_btree_insert_at(struct btree_trans *trans, ...@@ -569,7 +568,6 @@ static inline int do_btree_insert_at(struct btree_trans *trans,
if (race_fault()) { if (race_fault()) {
ret = -EINTR; ret = -EINTR;
trans_restart(" (race)");
trace_trans_restart_fault_inject(trans->ip); trace_trans_restart_fault_inject(trans->ip);
goto out; goto out;
} }
...@@ -718,7 +716,6 @@ int bch2_trans_commit_error(struct btree_trans *trans, ...@@ -718,7 +716,6 @@ int bch2_trans_commit_error(struct btree_trans *trans,
if (!ret || if (!ret ||
ret == -EINTR || ret == -EINTR ||
(flags & BTREE_INSERT_NOUNLOCK)) { (flags & BTREE_INSERT_NOUNLOCK)) {
trans_restart(" (split)");
trace_trans_restart_btree_node_split(trans->ip); trace_trans_restart_btree_node_split(trans->ip);
ret = -EINTR; ret = -EINTR;
} }
...@@ -738,7 +735,6 @@ int bch2_trans_commit_error(struct btree_trans *trans, ...@@ -738,7 +735,6 @@ int bch2_trans_commit_error(struct btree_trans *trans,
if (bch2_trans_relock(trans)) if (bch2_trans_relock(trans))
return 0; return 0;
trans_restart(" (iter relock after marking replicas)");
trace_trans_restart_mark_replicas(trans->ip); trace_trans_restart_mark_replicas(trans->ip);
ret = -EINTR; ret = -EINTR;
break; break;
...@@ -752,7 +748,6 @@ int bch2_trans_commit_error(struct btree_trans *trans, ...@@ -752,7 +748,6 @@ int bch2_trans_commit_error(struct btree_trans *trans,
if (bch2_trans_relock(trans)) if (bch2_trans_relock(trans))
return 0; return 0;
trans_restart(" (iter relock after journal res get blocked)");
trace_trans_restart_journal_res_get(trans->ip); trace_trans_restart_journal_res_get(trans->ip);
ret = -EINTR; ret = -EINTR;
break; break;
...@@ -765,7 +760,6 @@ int bch2_trans_commit_error(struct btree_trans *trans, ...@@ -765,7 +760,6 @@ int bch2_trans_commit_error(struct btree_trans *trans,
int ret2 = bch2_btree_iter_traverse_all(trans); int ret2 = bch2_btree_iter_traverse_all(trans);
if (ret2) { if (ret2) {
trans_restart(" (traverse)");
trace_trans_restart_traverse(trans->ip); trace_trans_restart_traverse(trans->ip);
return ret2; return ret2;
} }
...@@ -777,7 +771,6 @@ int bch2_trans_commit_error(struct btree_trans *trans, ...@@ -777,7 +771,6 @@ int bch2_trans_commit_error(struct btree_trans *trans,
if (!(flags & BTREE_INSERT_ATOMIC)) if (!(flags & BTREE_INSERT_ATOMIC))
return 0; return 0;
trans_restart(" (atomic)");
trace_trans_restart_atomic(trans->ip); trace_trans_restart_atomic(trans->ip);
} }
...@@ -803,12 +796,7 @@ static int __bch2_trans_commit(struct btree_trans *trans, ...@@ -803,12 +796,7 @@ static int __bch2_trans_commit(struct btree_trans *trans,
int ret; int ret;
trans_for_each_update_iter(trans, i) { 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)) { 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); trace_trans_restart_upgrade(trans->ip);
ret = -EINTR; ret = -EINTR;
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