From 6acb4fa9f4a76e1d6cbea6965bc20e8a00054702 Mon Sep 17 00:00:00 2001 From: Philip Taffet Date: Fri, 7 Feb 2025 21:10:52 +0000 Subject: [PATCH] pack: restrict bundles to bank 0 --- src/ballet/pack/fd_pack.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/ballet/pack/fd_pack.c b/src/ballet/pack/fd_pack.c index 2254166d4f..a944405247 100644 --- a/src/ballet/pack/fd_pack.c +++ b/src/ballet/pack/fd_pack.c @@ -2336,12 +2336,18 @@ fd_pack_schedule_next_microblock( fd_pack_t * pack, float vote_fraction, ulong bank_tile, fd_txn_p_t * out ) { - /* Try to schedule a bundle first */ - int bundle_result = fd_pack_try_schedule_bundle( pack, bank_tile, out ); - if( FD_UNLIKELY( bundle_result>0 ) ) return (ulong)bundle_result; - if( FD_UNLIKELY( bundle_result==TRY_BUNDLE_HAS_CONFLICTS ) ) return 0UL; - /* in the NO_READY_BUNDLES or DOES_NOT_FIT case, we schedule like - normal. */ + /* Because we schedule bundles strictly in order, we need to limit + bundles to a single bank. Otherwise, if a bundle is executing on a + certain bank and the next bundle conflicts with it, all the other + bank tiles will be idle until the first bundle completes. */ + if( FD_LIKELY( bank_tile==0UL ) ) { + /* Try to schedule a bundle first */ + int bundle_result = fd_pack_try_schedule_bundle( pack, bank_tile, out ); + if( FD_UNLIKELY( bundle_result>0 ) ) return (ulong)bundle_result; + if( FD_UNLIKELY( bundle_result==TRY_BUNDLE_HAS_CONFLICTS ) ) return 0UL; + /* in the NO_READY_BUNDLES or DOES_NOT_FIT case, we schedule like + normal. */ + } /* TODO: Decide if these are exactly how we want to handle limits */ total_cus = fd_ulong_min( total_cus, pack->lim->max_cost_per_block - pack->cumulative_block_cost );