@@ -37,6 +37,8 @@ snapshot_load_topo( config_t * config,
3737 fd_topob_new ( & config -> topo , config -> name );
3838 topo -> max_page_size = fd_cstr_to_shmem_page_sz ( config -> hugetlbfs .max_page_size );
3939
40+ #define FOR (cnt ) for( ulong i=0UL; i<cnt; i++ )
41+
4042 fd_topob_wksp ( topo , "txncache" );
4143 fd_topo_obj_t * txncache_obj = setup_topo_txncache ( topo , "txncache" ,
4244 config -> firedancer .runtime .max_live_slots ,
@@ -51,6 +53,7 @@ snapshot_load_topo( config_t * config,
5153
5254 int snapshot_lthash_disabled = config -> development .snapshots .disable_lthash_verification ;
5355 ulong lta_tile_cnt = config -> firedancer .layout .snapla_tile_count ;
56+ ulong dc_tile_cnt = config -> development .snapshots .decompress_tile_count ;
5457
5558 if ( config -> firedancer .vinyl .enabled ) {
5659 setup_topo_vinyl_meta ( topo , & config -> firedancer );
@@ -81,8 +84,7 @@ snapshot_load_topo( config_t * config,
8184
8285 /* "snapdc": Zstandard decompress tile */
8386 fd_topob_wksp ( topo , "snapdc" );
84- fd_topo_tile_t * snapdc_tile = fd_topob_tile ( topo , "snapdc" , "snapdc" , "metric_in" , ULONG_MAX , 0 , 0 );
85- snapdc_tile -> allow_shutdown = 1 ;
87+ FOR ( dc_tile_cnt ) fd_topob_tile ( topo , "snapdc ", " snapdc ", " metric_in ", ULONG_MAX, 0, 0 )->allow_shutdown = 1;
8688
8789 /* "snapin": Snapshot parser tile */
8890 fd_topob_wksp ( topo , "snapin" );
@@ -122,16 +124,14 @@ snapshot_load_topo( config_t * config,
122124 fd_topob_wksp ( topo , "snapls_ct" );
123125 }
124126
125- #define FOR (cnt ) for( ulong i=0UL; i<cnt; i++ )
126-
127127 if ( FD_LIKELY ( !snapshot_lthash_disabled ) ) {
128128 FOR (lta_tile_cnt ) fd_topob_tile ( topo , "snapla ", " snapla ", " metric_in ", ULONG_MAX, 0, 0 )->allow_shutdown = 1;
129129 /**/ fd_topob_tile( topo, " snapls ", " snapls ", " metric_in ", ULONG_MAX, 0, 0 )->allow_shutdown = 1;
130130 }
131131
132132 fd_topob_link ( topo , "snapct_ld" , "snapct_ld" , 128UL , sizeof (fd_ssctrl_init_t ), 1UL );
133133 fd_topob_link ( topo , "snapld_dc" , "snapld_dc" , 16384UL , USHORT_MAX , 1UL );
134- fd_topob_link ( topo , "snapdc_in" , "snapdc_in" , 16384UL , USHORT_MAX , 1UL );
134+ FOR ( dc_tile_cnt ) fd_topob_link ( topo , "snapdc_in ", " snapdc_in ", 16384UL, USHORT_MAX, 1UL );
135135 if ( FD_UNLIKELY ( snapshot_lthash_disabled ) ) {
136136 fd_topob_link ( topo , "snapin_ct" , "snapin_ct" , 128UL , 0UL , 1UL );
137137 }
@@ -159,9 +159,9 @@ snapshot_load_topo( config_t * config,
159159 fd_topob_tile_out ( topo , "snapct" , 0UL , "snapct_repr" , 0UL );
160160 fd_topob_tile_in ( topo , "snapld" , 0UL , "metric_in" , "snapct_ld" , 0UL , FD_TOPOB_RELIABLE , FD_TOPOB_POLLED );
161161 fd_topob_tile_out ( topo , "snapld" , 0UL , "snapld_dc" , 0UL );
162- fd_topob_tile_in ( topo , "snapdc" , 0UL , "metric_in" , "snapld_dc" , 0UL , FD_TOPOB_RELIABLE , FD_TOPOB_POLLED );
163- fd_topob_tile_out ( topo , "snapdc" , 0UL , "snapdc_in" , 0UL );
164- fd_topob_tile_in ( topo , "snapin" , 0UL , "metric_in" , "snapdc_in" , 0UL , FD_TOPOB_RELIABLE , FD_TOPOB_POLLED );
162+ FOR ( dc_tile_cnt ) fd_topob_tile_in ( topo , "snapdc ", i, " metric_in ", " snapld_dc ", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
163+ FOR ( dc_tile_cnt ) fd_topob_tile_out ( topo , "snapdc" , i , "snapdc_in" , i );
164+ FOR ( dc_tile_cnt ) fd_topob_tile_in ( topo , "snapin ", 0UL, " metric_in ", " snapdc_in ", i, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
165165 if ( FD_UNLIKELY ( snapshot_lthash_disabled ) ) {
166166 fd_topob_tile_out ( topo , "snapin" , 0UL , "snapin_ct" , 0UL );
167167 } else {
@@ -262,6 +262,7 @@ snapshot_load_args( int * pargc,
262262 " --fsck After loading, run database integrity checks\n"
263263 " --lthash After loading, recompute the account DB lthash\n"
264264 " --accounts-hist After loading, analyze account size distribution\n"
265+ " --dc-tiles Number of snapdc tiles\n"
265266 "\n"
266267 "Vinyl database flags:\n"
267268 " --vinyl-server After loading, indefinitely run a vinyl DB server\n"
@@ -295,6 +296,7 @@ snapshot_load_args( int * pargc,
295296 char const * vinyl_io = fd_env_strip_cmdline_cstr ( pargc , pargv , "--vinyl-io" , NULL , "bd" );
296297 float cache_sz = fd_env_strip_cmdline_float ( pargc , pargv , "--cache-sz" , NULL , 0.0f );
297298 float cache_rec_max = fd_env_strip_cmdline_float ( pargc , pargv , "--cache-rec-max" ,NULL , 0.0f );
299+ uint dc_tile_cnt = fd_env_strip_cmdline_uint ( pargc , pargv , "--dc-tiles" , NULL , 1U );
298300
299301 fd_cstr_ncpy ( args -> snapshot_load .snapshot_dir , snapshot_dir , sizeof (args -> snapshot_load .snapshot_dir ) );
300302 args -> snapshot_load .fsck = fsck ;
@@ -314,6 +316,7 @@ snapshot_load_args( int * pargc,
314316 args -> snapshot_load .db_rec_max = (ulong )db_rec_max ;
315317 args -> snapshot_load .cache_sz = (ulong )cache_sz ;
316318 args -> snapshot_load .cache_rec_max = (ulong )cache_rec_max ;
319+ args -> snapshot_load .dc_tile_cnt = (uint )dc_tile_cnt ;
317320
318321 fd_cstr_ncpy ( args -> snapshot_load .vinyl_path , vinyl_path , sizeof (args -> snapshot_load .vinyl_path ) );
319322
@@ -595,6 +598,7 @@ fixup_config( config_t * config,
595598 }
596599
597600 config -> development .snapshots .disable_lthash_verification = !args -> snapshot_load .lthash ;
601+ config -> development .snapshots .decompress_tile_count = args -> snapshot_load .dc_tile_cnt ;
598602
599603 /* FIXME Unfortunately, the fdctl boot procedure constructs the
600604 topology before parsing command-line arguments. So, here,
@@ -658,8 +662,6 @@ snapshot_load_cmd_fn( args_t * args,
658662 ulong total_off_old = 0UL ;
659663 ulong decomp_off_old = 0UL ;
660664 ulong vinyl_off_old = 0UL ;
661- ulong snapct_backp_old = 0UL ;
662- ulong snapct_wait_old = 0UL ;
663665 ulong snapld_backp_old = 0UL ;
664666 ulong snapld_wait_old = 0UL ;
665667 ulong snapdc_backp_old = 0UL ;
@@ -684,8 +686,8 @@ snapshot_load_cmd_fn( args_t * args,
684686 puts ( "" );
685687 fputs ( "--------------------------------------------" , stdout );
686688 if ( snapwr_tile ) fputs ( "--------------" , stdout );
687- if ( snapls_tile ) fputs ( "[ct],[ ld],[dc],[in],[lts]--------[ct], [ld],[dc],[in],[lts]" , stdout );
688- else fputs ( "[ct],[ ld],[dc],[in]--------[ct], [ld],[dc],[in]" , stdout );
689+ if ( snapls_tile ) fputs ( "[ld],[dc],[in],[lts]--------[ld],[dc],[in],[lts]" , stdout );
690+ else fputs ( "[ld],[dc],[in]--------[ld],[dc],[in]" , stdout );
689691 if ( snapwr_tile ) fputs ( ",[wh],[wr]" , stdout );
690692 puts ( "--------------" );
691693 }
@@ -712,8 +714,6 @@ snapshot_load_cmd_fn( args_t * args,
712714 ulong decomp_off = snapdc_metrics [ MIDX ( GAUGE , SNAPDC , FULL_DECOMPRESSED_BYTES_WRITTEN ) ] +
713715 snapdc_metrics [ MIDX ( GAUGE , SNAPDC , INCREMENTAL_DECOMPRESSED_BYTES_WRITTEN ) ];
714716 ulong vinyl_off = snapwr_tile ? snapwr_metrics [ MIDX ( GAUGE , SNAPWR , VINYL_BYTES_WRITTEN ) ] : 0UL ;
715- ulong snapct_backp = snapct_metrics [ MIDX ( COUNTER , TILE , REGIME_DURATION_NANOS_BACKPRESSURE_PREFRAG ) ];
716- ulong snapct_wait = snapct_metrics [ MIDX ( COUNTER , TILE , REGIME_DURATION_NANOS_CAUGHT_UP_POSTFRAG ) ] + snapct_backp ;
717717 ulong snapld_backp = snapld_metrics [ MIDX ( COUNTER , TILE , REGIME_DURATION_NANOS_BACKPRESSURE_PREFRAG ) ];
718718 ulong snapld_wait = snapld_metrics [ MIDX ( COUNTER , TILE , REGIME_DURATION_NANOS_CAUGHT_UP_POSTFRAG ) ] + snapld_backp ;
719719 ulong snapdc_backp = snapdc_metrics [ MIDX ( COUNTER , TILE , REGIME_DURATION_NANOS_BACKPRESSURE_PREFRAG ) ];
@@ -744,29 +744,25 @@ snapshot_load_cmd_fn( args_t * args,
744744 printf ( " vinyl=%4.0fMB/s" , (double )( vinyl_off - vinyl_off_old )/1e6 );
745745 }
746746 if ( !snapls_tile ) {
747- printf ( " backp=(%3.0f%%,%3.0f%%,%3.0f%%,%3.0f%%" ,
748- ( (double )( snapct_backp - snapct_backp_old )* ns_per_tick )/1e7 ,
747+ printf ( " backp=(%3.0f%%,%3.0f%%,%3.0f%%" ,
749748 ( (double )( snapld_backp - snapld_backp_old )* ns_per_tick )/1e7 ,
750749 ( (double )( snapdc_backp - snapdc_backp_old )* ns_per_tick )/1e7 ,
751750 ( (double )( snapin_backp - snapin_backp_old )* ns_per_tick )/1e7 );
752751 }
753752 else {
754- printf ( " backp=(%3.0f%%,%3.0f%%,%3.0f%%,%3.0f%%,%3.0f%%" ,
755- ( (double )( snapct_backp - snapct_backp_old )* ns_per_tick )/1e7 ,
753+ printf ( " backp=(%3.0f%%,%3.0f%%,%3.0f%%,%3.0f%%" ,
756754 ( (double )( snapld_backp - snapld_backp_old )* ns_per_tick )/1e7 ,
757755 ( (double )( snapdc_backp - snapdc_backp_old )* ns_per_tick )/1e7 ,
758756 ( (double )( snapin_backp - snapin_backp_old )* ns_per_tick )/1e7 ,
759757 ( (double )( snapls_backp - snapls_backp_old )* ns_per_tick )/1e7 );
760758 }
761759 if ( !snapls_tile ) {
762- printf ( ") busy=(%3.0f%%,%3.0f%%,%3.0f%%,%3.0f%%" ,
763- 100 - ( ( (double )( snapct_wait - snapct_wait_old )* ns_per_tick )/1e7 ),
760+ printf ( ") busy=(%3.0f%%,%3.0f%%,%3.0f%%" ,
764761 100 - ( ( (double )( snapld_wait - snapld_wait_old )* ns_per_tick )/1e7 ),
765762 100 - ( ( (double )( snapdc_wait - snapdc_wait_old )* ns_per_tick )/1e7 ),
766763 100 - ( ( (double )( snapin_wait - snapin_wait_old )* ns_per_tick )/1e7 ) );
767764 } else {
768- printf ( ") busy=(%3.0f%%,%3.0f%%,%3.0f%%,%3.0f%%,%3.0f%%" ,
769- 100 - ( ( (double )( snapct_wait - snapct_wait_old )* ns_per_tick )/1e7 ),
765+ printf ( ") busy=(%3.0f%%,%3.0f%%,%3.0f%%,%3.0f%%" ,
770766 100 - ( ( (double )( snapld_wait - snapld_wait_old )* ns_per_tick )/1e7 ),
771767 100 - ( ( (double )( snapdc_wait - snapdc_wait_old )* ns_per_tick )/1e7 ),
772768 100 - ( ( (double )( snapin_wait - snapin_wait_old )* ns_per_tick )/1e7 ),
@@ -784,8 +780,6 @@ snapshot_load_cmd_fn( args_t * args,
784780 total_off_old = total_off ;
785781 decomp_off_old = decomp_off ;
786782 vinyl_off_old = vinyl_off ;
787- snapct_backp_old = snapct_backp ;
788- snapct_wait_old = snapct_wait ;
789783 snapld_backp_old = snapld_backp ;
790784 snapld_wait_old = snapld_wait ;
791785 snapdc_backp_old = snapdc_backp ;
0 commit comments