]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bcachefs: Make more btree_paths available
authorKent Overstreet <kent.overstreet@linux.dev>
Sat, 27 Aug 2022 14:30:36 +0000 (10:30 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:39 +0000 (17:09 -0400)
 - Don't decrease BTREE_ITER_MAX when building with CONFIG_LOCKDEP
   anymore. The lockdep table sizes are configurable now, we don't need
   this anymore.
 - btree_trans_too_many_iters() is less conservative now. Previously it
   was causing a transaction restart if we had used more than
   BTREE_ITER_MAX / 2 paths, change this to BTREE_ITER_MAX - 8.

This helps with excessive transaction restarts/livelocks in the bucket
allocator path.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_iter.h

index 87b456998ef44a32296446c49c5bf997b6721957..1081ea753be6caf39353d1689705ac6e57214a33 100644 (file)
@@ -387,7 +387,7 @@ static inline struct bkey_s_c bch2_btree_iter_peek_upto_type(struct btree_iter *
 
 static inline int btree_trans_too_many_iters(struct btree_trans *trans)
 {
-       if (hweight64(trans->paths_allocated) > BTREE_ITER_MAX / 2) {
+       if (hweight64(trans->paths_allocated) > BTREE_ITER_MAX - 8) {
                trace_trans_restart_too_many_iters(trans, _THIS_IP_);
                return btree_trans_restart(trans, BCH_ERR_transaction_restart_too_many_iters);
        }