Skip to content

Commit

Permalink
pack: set manual lazy value
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcgee-jump committed Dec 12, 2023
1 parent 279b681 commit cca6764
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app/fdctl/run/run1.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ tile_main( void * _args ) {
void * ctx = NULL;
if( FD_LIKELY( config->mux_ctx ) ) ctx = config->mux_ctx( scratch_mem );

long lazy = 0L;
if( FD_UNLIKELY( config->lazy ) ) lazy = config->lazy( scratch_mem );

fd_rng_t rng[1];
fd_mux_tile( tile->cnc,
config->mux_flags,
Expand All @@ -160,7 +163,7 @@ tile_main( void * _args ) {
out_fseq,
config->burst,
0,
0,
lazy,
fd_rng_join( fd_rng_new( rng, 0, 0UL ) ),
fd_alloca( FD_MUX_TILE_SCRATCH_ALIGN, FD_MUX_TILE_SCRATCH_FOOTPRINT( tile->in_cnt, out_cnt_reliable ) ),
ctx,
Expand Down
16 changes: 16 additions & 0 deletions src/app/fdctl/run/tiles/fd_pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,21 @@ unprivileged_init( fd_topo_t * topo,
FD_LOG_ERR(( "scratch overflow %lu %lu %lu", scratch_top - (ulong)scratch - scratch_footprint( tile ), scratch_top, (ulong)scratch + scratch_footprint( tile ) ));
}

static long
lazy( fd_topo_tile_t * tile ) {
(void)tile;
/* We want lazy (measured in ns) to be small enough that the producer
and the consumer never have to wait for credits. For most tango
links, we use a default worst case speed coming from 100 Gbps
Ethernet. That's not very suitable for microblocks that go from
pack to bank. Instead we manually estimate the very aggressive
1000ns per microblock, and then reduce it further (in line with the
default lazy value computation) to ensure the random value chosen
based on this won't lead to credit return stalls. */
return 128L * 300L;
}


static ulong
populate_allowed_seccomp( void * scratch,
ulong out_cnt,
Expand Down Expand Up @@ -512,6 +527,7 @@ fd_tile_config_t fd_tile_pack = {
.mux_after_credit = after_credit,
.mux_during_frag = during_frag,
.mux_after_frag = after_frag,
.lazy = lazy,
.populate_allowed_seccomp = populate_allowed_seccomp,
.populate_allowed_fds = populate_allowed_fds,
.scratch_align = scratch_align,
Expand Down
1 change: 1 addition & 0 deletions src/app/fdctl/run/tiles/tiles.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ typedef struct {
fd_mux_after_frag_fn * mux_after_frag;
fd_mux_metrics_write_fn * mux_metrics_write;

long (*lazy )( fd_topo_tile_t * tile );
ulong (*populate_allowed_seccomp)( void * scratch, ulong out_cnt, struct sock_filter * out );
ulong (*populate_allowed_fds )( void * scratch, ulong out_fds_sz, int * out_fds );
ulong (*loose_footprint )( fd_topo_tile_t * tile );
Expand Down

0 comments on commit cca6764

Please sign in to comment.