24
24
#include "../../../util/pod/fd_pod_format.h"
25
25
#include "../../../discof/replay/fd_replay_notif.h"
26
26
#include "../../../discof/reasm/fd_reasm.h"
27
+ #include "../../../discof/restore/utils/fd_ssctrl.h"
27
28
#include "../../../flamenco/runtime/fd_runtime_public.h" /* FD_RUNTIME_PUBLIC_ACCOUNT_UPDATE_MSG_MTU */
28
29
#include "../main.h"
29
30
@@ -36,6 +37,7 @@ static void
36
37
backtest_topo ( config_t * config ) {
37
38
ulong exec_tile_cnt = config -> firedancer .layout .exec_tile_count ;
38
39
ulong writer_tile_cnt = config -> firedancer .layout .writer_tile_count ;
40
+ ulong hash_tile_cnt = config -> firedancer .layout .hash_tile_count ;
39
41
40
42
fd_topo_t * topo = { fd_topob_new ( & config -> topo , config -> name ) };
41
43
topo -> max_page_size = fd_cstr_to_shmem_page_sz ( config -> hugetlbfs .max_page_size );
@@ -99,6 +101,15 @@ backtest_topo( config_t * config ) {
99
101
snapdc_tile -> allow_shutdown = 1 ;
100
102
snapin_tile -> allow_shutdown = 1 ;
101
103
104
+ if ( FD_LIKELY ( hash_tile_cnt ) ) {
105
+ fd_topob_wksp ( topo , "snaphs" );
106
+ }
107
+
108
+ for ( ulong i = 0UL ; i < hash_tile_cnt ; i ++ ) {
109
+ fd_topo_tile_t * snaphsh_tile = fd_topob_tile ( topo , "snaphs" , "snaphs" , "metric_in" , cpu_idx ++ , 0 , 0 );
110
+ snaphsh_tile -> allow_shutdown = 1 ;
111
+ }
112
+
102
113
/**********************************************************************/
103
114
/* Setup backtest->replay link (repair_repla) in topo */
104
115
/**********************************************************************/
@@ -121,16 +132,23 @@ backtest_topo( config_t * config ) {
121
132
fd_topob_wksp ( topo , "snapdc_rd" );
122
133
fd_topob_wksp ( topo , "snapin_rd" );
123
134
fd_topob_wksp ( topo , "snap_out" );
124
- fd_topob_wksp ( topo , "replay_manif" );
135
+
136
+ if ( FD_LIKELY ( hash_tile_cnt ) ) {
137
+ fd_topob_wksp ( topo , "snapin_hsh" );
138
+ fd_topob_wksp ( topo , "snaphsh_out" );
139
+ }
140
+
125
141
/* TODO: Should be depth of 1 or 2, not 4, but it causes backpressure
126
142
from the replay tile parsing the manifest, remove when this is
127
143
fixed. */
128
144
fd_topob_link ( topo , "snap_out" , "snap_out" , 4UL , 5UL * (1UL <<30UL ), 1UL );
129
145
130
146
fd_topob_link ( topo , "snap_zstd" , "snap_zstd" , 8192UL , 16384UL , 1UL );
131
147
fd_topob_link ( topo , "snap_stream" , "snap_stream" , 2048UL , USHORT_MAX , 1UL );
132
- fd_topob_link ( topo , "snapdc_rd" , "snapdc_rd" , 128UL , 0UL , 1UL );
133
- fd_topob_link ( topo , "snapin_rd" , "snapin_rd" , 128UL , 0UL , 1UL );
148
+ fd_topob_link ( topo , "snapdc_rd" , "snapdc_rd" , 128UL , 0UL , 1UL );
149
+ fd_topob_link ( topo , "snapin_rd" , "snapin_rd" , 128UL , 0UL , 1UL );
150
+ FOR (hash_tile_cnt ) fd_topob_link ( topo , "snapin_hsh ", " snapin_hsh ", 128UL, sizeof(fd_snapshot_existing_account_t), 1UL );
151
+ FOR (hash_tile_cnt ) fd_topob_link ( topo , "snaphsh_out" , "snaphsh_out" , 128UL , 2048UL , 1UL );
134
152
135
153
fd_topob_tile_out ( topo , "snaprd" , 0UL , "snap_zstd" , 0UL );
136
154
fd_topob_tile_in ( topo , "snapdc" , 0UL , "metric_in" , "snap_zstd" , 0UL , FD_TOPOB_RELIABLE , FD_TOPOB_POLLED );
@@ -144,6 +162,12 @@ backtest_topo( config_t * config ) {
144
162
fd_topob_tile_in ( topo , "snaprd" , 0UL , "metric_in" , "snapin_rd" , 0UL , FD_TOPOB_RELIABLE , FD_TOPOB_POLLED );
145
163
fd_topob_tile_out ( topo , "snapin" , 0UL , "snapin_rd" , 0UL );
146
164
165
+ FOR (hash_tile_cnt ) fd_topob_tile_out ( topo , "snapin ", 0UL, " snapin_hsh ", i );
166
+ FOR (hash_tile_cnt ) fd_topob_tile_in ( topo , "snapin" , 0UL , "metric_in" , "snaphsh_out" , i , FD_TOPOB_RELIABLE , FD_TOPOB_POLLED );
167
+
168
+ FOR (hash_tile_cnt ) fd_topob_tile_in ( topo , "snaphs ", i, " metric_in ", " snapin_hsh ", i, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
169
+ FOR (hash_tile_cnt ) fd_topob_tile_out ( topo , "snaphs" , i , "snaphsh_out" , i );
170
+
147
171
/**********************************************************************/
148
172
/* More backtest->replay links in topo */
149
173
/**********************************************************************/
@@ -312,15 +336,7 @@ backtest_topo( config_t * config ) {
312
336
FD_TEST ( fd_pod_insertf_ulong ( topo -> props , busy_obj -> id , "bank_busy.%lu" , i ) );
313
337
}
314
338
315
- /* Replay decoded manifest dcache topo obj */
316
- fd_topo_obj_t * replay_manifest_dcache = fd_topob_obj ( topo , "dcache" , "replay_manif" );
317
- fd_pod_insertf_ulong ( topo -> props , 2UL << 30UL , "obj.%lu.data_sz" , replay_manifest_dcache -> id );
318
- fd_pod_insert_ulong ( topo -> props , "manifest_dcache" , replay_manifest_dcache -> id );
319
-
320
339
fd_topob_tile_uses ( topo , snapin_tile , funk_obj , FD_SHMEM_JOIN_MODE_READ_WRITE );
321
- fd_topob_tile_uses ( topo , snapin_tile , replay_manifest_dcache , FD_SHMEM_JOIN_MODE_READ_WRITE );
322
- fd_topob_tile_uses ( topo , replay_tile , replay_manifest_dcache , FD_SHMEM_JOIN_MODE_READ_ONLY );
323
-
324
340
for ( ulong i = 0UL ; i < topo -> tile_cnt ; i ++ ) {
325
341
fd_topo_tile_t * tile = & topo -> tiles [ i ];
326
342
if ( !fd_topo_configure_tile ( tile , config ) ) {
@@ -398,9 +414,13 @@ backtest_cmd_fn( args_t * args FD_PARAM_UNUSED,
398
414
fd_topo_tile_t * snapdc_tile = & topo -> tiles [ fd_topo_find_tile ( topo , "snapdc" , 0UL ) ];
399
415
fd_topo_tile_t * snapin_tile = & topo -> tiles [ fd_topo_find_tile ( topo , "snapin" , 0UL ) ];
400
416
417
+ ulong snaphs_tile_idx = fd_topo_find_tile ( topo , "snaphs" , 0UL );
418
+ fd_topo_tile_t * snaphs_tile = snaphs_tile_idx != ULONG_MAX ? & topo -> tiles [ snaphs_tile_idx ] : NULL ;
419
+
401
420
ulong volatile * const snaprd_metrics = fd_metrics_tile ( snaprd_tile -> metrics );
402
421
ulong volatile * const snapdc_metrics = fd_metrics_tile ( snapdc_tile -> metrics );
403
422
ulong volatile * const snapin_metrics = fd_metrics_tile ( snapin_tile -> metrics );
423
+ ulong volatile * const snaphs_metrics = snaphs_tile ? fd_metrics_tile ( snaphs_tile -> metrics ) : NULL ;
404
424
405
425
ulong total_off_old = 0UL ;
406
426
ulong snaprd_backp_old = 0UL ;
@@ -409,6 +429,8 @@ backtest_cmd_fn( args_t * args FD_PARAM_UNUSED,
409
429
ulong snapdc_wait_old = 0UL ;
410
430
ulong snapin_backp_old = 0UL ;
411
431
ulong snapin_wait_old = 0UL ;
432
+ ulong snaphs_backp_old = 0UL ;
433
+ ulong snaphs_wait_old = 0UL ;
412
434
ulong acc_cnt_old = 0UL ;
413
435
sleep ( 1 );
414
436
puts ( "-------------backp=(snaprd,snapdc,snapin) busy=(snaprd,snapdc,snapin)---------------" );
@@ -417,8 +439,9 @@ backtest_cmd_fn( args_t * args FD_PARAM_UNUSED,
417
439
ulong snaprd_status = FD_VOLATILE_CONST ( snaprd_metrics [ MIDX ( GAUGE , TILE , STATUS ) ] );
418
440
ulong snapdc_status = FD_VOLATILE_CONST ( snapdc_metrics [ MIDX ( GAUGE , TILE , STATUS ) ] );
419
441
ulong snapin_status = FD_VOLATILE_CONST ( snapin_metrics [ MIDX ( GAUGE , TILE , STATUS ) ] );
442
+ ulong snaphs_status = snaphs_metrics ? FD_VOLATILE_CONST ( snaphs_metrics [ MIDX ( GAUGE , TILE , STATUS ) ] ) : 2UL ;
420
443
421
- if ( FD_UNLIKELY ( snaprd_status == 2UL && snapdc_status == 2UL && snapin_status == 2UL ) ) break ;
444
+ if ( FD_UNLIKELY ( snaprd_status == 2UL && snapdc_status == 2UL && snapin_status == 2UL && snaphs_status == 2UL ) ) break ;
422
445
423
446
long cur = fd_log_wallclock ();
424
447
if ( FD_UNLIKELY ( cur < next ) ) {
@@ -438,16 +461,21 @@ backtest_cmd_fn( args_t * args FD_PARAM_UNUSED,
438
461
ulong snapin_backp = snapin_metrics [ MIDX ( COUNTER , TILE , REGIME_DURATION_NANOS_BACKPRESSURE_PREFRAG ) ];
439
462
ulong snapin_wait = snapin_metrics [ MIDX ( COUNTER , TILE , REGIME_DURATION_NANOS_CAUGHT_UP_PREFRAG ) ] +
440
463
snapin_metrics [ MIDX ( COUNTER , TILE , REGIME_DURATION_NANOS_CAUGHT_UP_POSTFRAG ) ] + snapin_backp ;
464
+ ulong snaphs_backp = snaphs_metrics ? snaphs_metrics [ MIDX ( COUNTER , TILE , REGIME_DURATION_NANOS_BACKPRESSURE_PREFRAG ) ] : 0UL ;
465
+ ulong snaphs_wait = snaphs_metrics ? snaphs_metrics [ MIDX ( COUNTER , TILE , REGIME_DURATION_NANOS_CAUGHT_UP_PREFRAG ) ] +
466
+ snaphs_metrics [ MIDX ( COUNTER , TILE , REGIME_DURATION_NANOS_CAUGHT_UP_POSTFRAG ) ] + snaphs_backp : 0UL ;
441
467
442
468
ulong acc_cnt = snapin_metrics [ MIDX ( GAUGE , SNAPIN , ACCOUNTS_INSERTED ) ];
443
- printf ( "bw=%4.0f MB/s backp=(%3.0f%%,%3.0f%%,%3.0f%%) busy=(%3.0f%%,%3.0f%%,%3.0f%%) acc=%3.1f M/s\n" ,
469
+ printf ( "bw=%4.0f MB/s backp=(%3.0f%%,%3.0f%%,%3.0f%%,%3.0f%% ) busy=(%3.0f%%, %3.0f%%,%3.0f%%,%3.0f%%) acc=%3.1f M/s\n" ,
444
470
(double )( total_off - total_off_old )/1e6 ,
445
471
( (double )( snaprd_backp - snaprd_backp_old )* ns_per_tick )/1e7 ,
446
472
( (double )( snapdc_backp - snapdc_backp_old )* ns_per_tick )/1e7 ,
447
473
( (double )( snapin_backp - snapin_backp_old )* ns_per_tick )/1e7 ,
474
+ ( (double )( snaphs_backp - snaphs_backp_old )* ns_per_tick )/1e7 ,
448
475
100 - ( ( (double )( snaprd_wait - snaprd_wait_old )* ns_per_tick )/1e7 ),
449
476
100 - ( ( (double )( snapdc_wait - snapdc_wait_old )* ns_per_tick )/1e7 ),
450
477
100 - ( ( (double )( snapin_wait - snapin_wait_old )* ns_per_tick )/1e7 ),
478
+ 100 - ( ( (double )( snaphs_wait - snaphs_wait_old )* ns_per_tick )/1e7 ),
451
479
(double )( acc_cnt - acc_cnt_old )/1e6 );
452
480
fflush ( stdout );
453
481
total_off_old = total_off ;
@@ -457,6 +485,8 @@ backtest_cmd_fn( args_t * args FD_PARAM_UNUSED,
457
485
snapdc_wait_old = snapdc_wait ;
458
486
snapin_backp_old = snapin_backp ;
459
487
snapin_wait_old = snapin_wait ;
488
+ snaphs_backp_old = snaphs_backp ;
489
+ snaphs_wait_old = snaphs_wait ;
460
490
acc_cnt_old = acc_cnt ;
461
491
462
492
next += 1000L * 1000L * 1000L ;
0 commit comments