Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions book/api/metrics-generated.md
Original file line number Diff line number Diff line change
Expand Up @@ -1057,3 +1057,19 @@
| <span class="metrics-name">backt_&#8203;start_&#8203;slot</span> | gauge | The slot at which the backtest started |

</div>

## Exec Tile

<div class="metrics">

| Metric | Type | Description |
|--------|------|-------------|
| <span class="metrics-name">exec_&#8203;progcache_&#8203;misses</span> | counter | Number of program cache misses |
| <span class="metrics-name">exec_&#8203;progcache_&#8203;hits</span> | counter | Number of program cache hits |
| <span class="metrics-name">exec_&#8203;progcache_&#8203;fills</span> | counter | Number of program cache insertions |
| <span class="metrics-name">exec_&#8203;progcache_&#8203;fill_&#8203;tot_&#8203;sz</span> | counter | Total number of bytes inserted into program cache |
| <span class="metrics-name">exec_&#8203;progcache_&#8203;fill_&#8203;fails</span> | counter | Number of program cache load fails (tombstones inserted) |
| <span class="metrics-name">exec_&#8203;progcache_&#8203;dup_&#8203;inserts</span> | counter | Number of time two tiles raced to insert the same cache entry |
| <span class="metrics-name">exec_&#8203;progcache_&#8203;invalidations</span> | counter | Number of program cache invalidations |

</div>
10 changes: 9 additions & 1 deletion src/app/firedancer-dev/commands/backtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "../../../ballet/lthash/fd_lthash.h"
#include "../../../flamenco/runtime/context/fd_capture_ctx.h"
#include "../../../disco/pack/fd_pack_cost.h"
#include "../../../flamenco/progcache/fd_progcache_admin.h"

#include "../main.h"

Expand Down Expand Up @@ -77,9 +78,16 @@ backtest_topo( config_t * config ) {
config->firedancer.funk.max_database_transactions,
config->firedancer.funk.heap_size_gib,
config->firedancer.funk.lock_pages );

fd_topob_tile_uses( topo, replay_tile, funk_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );

fd_topob_wksp( topo, "progcache" );
fd_topo_obj_t * progcache_obj = setup_topo_progcache( topo, "progcache",
fd_progcache_est_rec_max( config->firedancer.runtime.program_cache.heap_size_mib<<20,
config->firedancer.runtime.program_cache.mean_cache_entry_size ),
config->firedancer.funk.max_database_transactions,
config->firedancer.runtime.program_cache.heap_size_mib<<20 );
fd_topob_tile_uses( topo, replay_tile, progcache_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );

/**********************************************************************/
/* Add the executor tiles to topo */
/**********************************************************************/
Expand Down
11 changes: 11 additions & 0 deletions src/app/firedancer/config/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,17 @@ user = ""
# max_fork_width, the client will crash.
max_fork_width = 32

# The program cache pre-loads frequently executed programs for
# faster transaction execution.
[runtime.program_cache]
# The size of the loaded program cache in MiB.
heap_size_mib = 2048

# The mean expected heap utilization of a cache entry. Controls
# the size of metadata structures (e.g. cache entry table). It
# is not recommended to change this setting.
mean_cache_entry_size = 131072

# This section configures the "groove" persistent account database.
# [groove]
# ...
Expand Down
57 changes: 49 additions & 8 deletions src/app/firedancer/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "../../discof/restore/utils/fd_ssmsg.h"
#include "../../flamenco/gossip/fd_gossip.h"
#include "../../flamenco/runtime/context/fd_capture_ctx.h"
#include "../../funk/fd_funk.h" /* funk_footprint() */
#include "../../flamenco/progcache/fd_progcache_admin.h"

#include <sys/random.h>
#include <sys/types.h>
Expand Down Expand Up @@ -99,6 +99,35 @@ setup_topo_funk( fd_topo_t * topo,
return obj;
}

fd_topo_obj_t *
setup_topo_progcache( fd_topo_t * topo,
char const * wksp_name,
ulong max_cache_entries,
ulong max_database_transactions,
ulong heap_size ) {
fd_topo_obj_t * obj = fd_topob_obj( topo, "funk", wksp_name );
FD_TEST( fd_pod_insert_ulong( topo->props, "progcache", obj->id ) );
FD_TEST( fd_pod_insertf_ulong( topo->props, max_cache_entries, "obj.%lu.rec_max", obj->id ) );
FD_TEST( fd_pod_insertf_ulong( topo->props, max_database_transactions, "obj.%lu.txn_max", obj->id ) );
FD_TEST( fd_pod_insertf_ulong( topo->props, heap_size, "obj.%lu.heap_max", obj->id ) );
ulong funk_footprint = fd_funk_footprint( max_database_transactions, max_cache_entries );
if( FD_UNLIKELY( !funk_footprint ) ) FD_LOG_ERR(( "Invalid [runtime.program_cache] parameters" ));
if( FD_UNLIKELY( heap_size<(2*funk_footprint) ) ) {
FD_LOG_ERR(( "Invalid [runtime.program_cache] parameters: heap_size_mib should be at least %lu",
( 4*funk_footprint )>>20 ));
}

/* Increase workspace partition count */
ulong wksp_idx = fd_topo_find_wksp( topo, wksp_name );
FD_TEST( wksp_idx!=ULONG_MAX );
fd_topo_wksp_t * wksp = &topo->workspaces[ wksp_idx ];
ulong part_max = fd_wksp_part_max_est( heap_size, 1U<<14U );
if( FD_UNLIKELY( !part_max ) ) FD_LOG_ERR(( "fd_wksp_part_max_est(%lu,16KiB) failed", funk_footprint ));
wksp->part_max += part_max;

return obj;
}

fd_topo_obj_t *
setup_topo_store( fd_topo_t * topo,
char const * wksp_name,
Expand Down Expand Up @@ -276,8 +305,8 @@ fd_topo_initialize( config_t * config ) {
fd_topob_wksp( topo, "poh_shred" );
fd_topob_wksp( topo, "poh_replay" );

/* TODO: WTF are these for? */
fd_topob_wksp( topo, "funk" );
fd_topob_wksp( topo, "progcache" );
fd_topob_wksp( topo, "bh_cmp" );
fd_topob_wksp( topo, "fec_sets" );
fd_topob_wksp( topo, "txncache" );
Expand Down Expand Up @@ -708,6 +737,15 @@ fd_topo_initialize( config_t * config ) {
FOR(resolv_tile_cnt) fd_topob_tile_uses( topo, &topo->tiles[ fd_topo_find_tile( topo, "resolv", i ) ], banks_obj, FD_SHMEM_JOIN_MODE_READ_ONLY );
FD_TEST( fd_pod_insertf_ulong( topo->props, banks_obj->id, "banks" ) );

fd_topo_obj_t * progcache_obj = setup_topo_progcache( topo, "progcache",
fd_progcache_est_rec_max( config->firedancer.runtime.program_cache.heap_size_mib<<20,
config->firedancer.runtime.program_cache.mean_cache_entry_size ),
config->firedancer.funk.max_database_transactions,
config->firedancer.runtime.program_cache.heap_size_mib<<20 );
/**/ fd_topob_tile_uses( topo, &topo->tiles[ fd_topo_find_tile( topo, "replay", 0UL ) ], progcache_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
FOR(exec_tile_cnt) fd_topob_tile_uses( topo, &topo->tiles[ fd_topo_find_tile( topo, "exec", i ) ], progcache_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
FOR(bank_tile_cnt) fd_topob_tile_uses( topo, &topo->tiles[ fd_topo_find_tile( topo, "bank", i ) ], progcache_obj, FD_SHMEM_JOIN_MODE_READ_ONLY );

/* TODO: This should not exist in production */
fd_topo_obj_t * bank_hash_cmp_obj = setup_topo_bank_hash_cmp( topo, "bh_cmp" );
/**/ fd_topob_tile_uses( topo, &topo->tiles[ fd_topo_find_tile( topo, "replay", 0UL ) ], bank_hash_cmp_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
Expand Down Expand Up @@ -901,8 +939,9 @@ fd_topo_configure_tile( fd_topo_tile_t * tile,

tile->replay.tx_metadata_storage = config->rpc.extended_tx_metadata_storage;

tile->replay.txncache_obj_id = fd_pod_query_ulong( config->topo.props, "txncache", ULONG_MAX );
tile->replay.funk_obj_id = fd_pod_query_ulong( config->topo.props, "funk", ULONG_MAX );
tile->replay.txncache_obj_id = fd_pod_query_ulong( config->topo.props, "txncache", ULONG_MAX ); FD_TEST( tile->replay.txncache_obj_id !=ULONG_MAX );
tile->replay.funk_obj_id = fd_pod_query_ulong( config->topo.props, "funk", ULONG_MAX ); FD_TEST( tile->replay.funk_obj_id !=ULONG_MAX );
tile->replay.progcache_obj_id = fd_pod_query_ulong( config->topo.props, "progcache", ULONG_MAX ); FD_TEST( tile->replay.progcache_obj_id!=ULONG_MAX );

strncpy( tile->replay.cluster_version, config->tiles.replay.cluster_version, sizeof(tile->replay.cluster_version) );

Expand All @@ -925,8 +964,9 @@ fd_topo_configure_tile( fd_topo_tile_t * tile,

} else if( FD_UNLIKELY( !strcmp( tile->name, "exec" ) ) ) {

tile->exec.funk_obj_id = fd_pod_query_ulong( config->topo.props, "funk", ULONG_MAX );
tile->exec.txncache_obj_id = fd_pod_query_ulong( config->topo.props, "txncache", ULONG_MAX );
tile->exec.funk_obj_id = fd_pod_query_ulong( config->topo.props, "funk", ULONG_MAX ); FD_TEST( tile->exec.funk_obj_id !=ULONG_MAX );
tile->exec.txncache_obj_id = fd_pod_query_ulong( config->topo.props, "txncache", ULONG_MAX ); FD_TEST( tile->exec.txncache_obj_id !=ULONG_MAX );
tile->exec.progcache_obj_id = fd_pod_query_ulong( config->topo.props, "progcache", ULONG_MAX ); FD_TEST( tile->exec.progcache_obj_id!=ULONG_MAX );

tile->exec.max_live_slots = config->firedancer.runtime.max_live_slots;

Expand Down Expand Up @@ -999,8 +1039,9 @@ fd_topo_configure_tile( fd_topo_tile_t * tile,
}

} else if( FD_UNLIKELY( !strcmp( tile->name, "bank" ) ) ) {
tile->bank.txncache_obj_id = fd_pod_query_ulong( config->topo.props, "txncache", ULONG_MAX );
tile->bank.funk_obj_id = fd_pod_query_ulong( config->topo.props, "funk", ULONG_MAX );
tile->bank.txncache_obj_id = fd_pod_query_ulong( config->topo.props, "txncache", ULONG_MAX );
tile->bank.funk_obj_id = fd_pod_query_ulong( config->topo.props, "funk", ULONG_MAX );
tile->bank.progcache_obj_id = fd_pod_query_ulong( config->topo.props, "progcache", ULONG_MAX );

tile->bank.max_live_slots = config->firedancer.runtime.max_live_slots;

Expand Down
7 changes: 7 additions & 0 deletions src/app/firedancer/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ setup_topo_funk( fd_topo_t * topo,
ulong heap_size_gib,
int lock_pages );

fd_topo_obj_t *
setup_topo_progcache( fd_topo_t * topo,
char const * wksp_name,
ulong max_cache_entries,
ulong max_database_transactions,
ulong heap_size_gib );

fd_topo_obj_t *
setup_topo_runtime_pub( fd_topo_t * topo,
char const * wksp_name,
Expand Down
5 changes: 5 additions & 0 deletions src/app/shared/fd_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ struct fd_configf {
ulong max_live_slots;
ulong max_vote_accounts;
ulong max_fork_width;

struct {
ulong heap_size_mib;
ulong mean_cache_entry_size;
} program_cache;
} runtime;

struct {
Expand Down
3 changes: 3 additions & 0 deletions src/app/shared/fd_config_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ fd_config_extract_podf( uchar * pod,
CFG_POP ( ulong, runtime.max_vote_accounts );
CFG_POP ( ulong, runtime.max_fork_width );

CFG_POP ( ulong, runtime.program_cache.heap_size_mib );
CFG_POP ( ulong, runtime.program_cache.mean_cache_entry_size );

CFG_POP ( ulong, store.max_completed_shred_sets );

CFG_POP ( bool, snapshots.incremental_snapshots );
Expand Down
Binary file added src/ballet/sbpf/fixtures/malformed_bytecode.so
Binary file not shown.
1 change: 1 addition & 0 deletions src/disco/metrics/generate/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class Tile(Enum):
BANKF = 29
RESOLF = 30
BACKT = 31
EXEC = 32

class MetricType(Enum):
COUNTER = 0
Expand Down
3 changes: 3 additions & 0 deletions src/disco/metrics/generated/fd_metrics_all.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const char * FD_METRICS_TILE_KIND_NAMES[FD_METRICS_TILE_KIND_CNT] = {
"bankf",
"resolf",
"backt",
"exec",
};

const ulong FD_METRICS_TILE_KIND_SIZES[FD_METRICS_TILE_KIND_CNT] = {
Expand Down Expand Up @@ -95,6 +96,7 @@ const ulong FD_METRICS_TILE_KIND_SIZES[FD_METRICS_TILE_KIND_CNT] = {
FD_METRICS_BANKF_TOTAL,
FD_METRICS_RESOLF_TOTAL,
FD_METRICS_BACKT_TOTAL,
FD_METRICS_EXEC_TOTAL,
};
const fd_metrics_meta_t * FD_METRICS_TILE_KIND_METRICS[FD_METRICS_TILE_KIND_CNT] = {
FD_METRICS_NET,
Expand Down Expand Up @@ -125,4 +127,5 @@ const fd_metrics_meta_t * FD_METRICS_TILE_KIND_METRICS[FD_METRICS_TILE_KIND_CNT]
FD_METRICS_BANKF,
FD_METRICS_RESOLF,
FD_METRICS_BACKT,
FD_METRICS_EXEC,
};
3 changes: 2 additions & 1 deletion src/disco/metrics/generated/fd_metrics_all.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "fd_metrics_metric.h"
#include "fd_metrics_ipecho.h"
#include "fd_metrics_backt.h"
#include "fd_metrics_exec.h"
/* Start of LINK OUT metrics */

#define FD_METRICS_COUNTER_LINK_SLOW_COUNT_OFF (0UL)
Expand Down Expand Up @@ -166,7 +167,7 @@ extern const fd_metrics_meta_t FD_METRICS_ALL_LINK_OUT[FD_METRICS_ALL_LINK_OUT_T

#define FD_METRICS_TOTAL_SZ (8UL*253UL)

#define FD_METRICS_TILE_KIND_CNT 28
#define FD_METRICS_TILE_KIND_CNT 29
extern const char * FD_METRICS_TILE_KIND_NAMES[FD_METRICS_TILE_KIND_CNT];
extern const ulong FD_METRICS_TILE_KIND_SIZES[FD_METRICS_TILE_KIND_CNT];
extern const fd_metrics_meta_t * FD_METRICS_TILE_KIND_METRICS[FD_METRICS_TILE_KIND_CNT];
12 changes: 12 additions & 0 deletions src/disco/metrics/generated/fd_metrics_exec.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* THIS FILE IS GENERATED BY gen_metrics.py. DO NOT HAND EDIT. */
#include "fd_metrics_exec.h"

const fd_metrics_meta_t FD_METRICS_EXEC[FD_METRICS_EXEC_TOTAL] = {
DECLARE_METRIC( EXEC_PROGCACHE_MISSES, COUNTER ),
DECLARE_METRIC( EXEC_PROGCACHE_HITS, COUNTER ),
DECLARE_METRIC( EXEC_PROGCACHE_FILLS, COUNTER ),
DECLARE_METRIC( EXEC_PROGCACHE_FILL_TOT_SZ, COUNTER ),
DECLARE_METRIC( EXEC_PROGCACHE_FILL_FAILS, COUNTER ),
DECLARE_METRIC( EXEC_PROGCACHE_DUP_INSERTS, COUNTER ),
DECLARE_METRIC( EXEC_PROGCACHE_INVALIDATIONS, COUNTER ),
};
49 changes: 49 additions & 0 deletions src/disco/metrics/generated/fd_metrics_exec.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/* THIS FILE IS GENERATED BY gen_metrics.py. DO NOT HAND EDIT. */

#include "../fd_metrics_base.h"
#include "fd_metrics_enums.h"

#define FD_METRICS_COUNTER_EXEC_PROGCACHE_MISSES_OFF (16UL)
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_MISSES_NAME "exec_progcache_misses"
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_MISSES_TYPE (FD_METRICS_TYPE_COUNTER)
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_MISSES_DESC "Number of program cache misses"
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_MISSES_CVT (FD_METRICS_CONVERTER_NONE)

#define FD_METRICS_COUNTER_EXEC_PROGCACHE_HITS_OFF (17UL)
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_HITS_NAME "exec_progcache_hits"
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_HITS_TYPE (FD_METRICS_TYPE_COUNTER)
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_HITS_DESC "Number of program cache hits"
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_HITS_CVT (FD_METRICS_CONVERTER_NONE)

#define FD_METRICS_COUNTER_EXEC_PROGCACHE_FILLS_OFF (18UL)
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_FILLS_NAME "exec_progcache_fills"
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_FILLS_TYPE (FD_METRICS_TYPE_COUNTER)
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_FILLS_DESC "Number of program cache insertions"
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_FILLS_CVT (FD_METRICS_CONVERTER_NONE)

#define FD_METRICS_COUNTER_EXEC_PROGCACHE_FILL_TOT_SZ_OFF (19UL)
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_FILL_TOT_SZ_NAME "exec_progcache_fill_tot_sz"
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_FILL_TOT_SZ_TYPE (FD_METRICS_TYPE_COUNTER)
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_FILL_TOT_SZ_DESC "Total number of bytes inserted into program cache"
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_FILL_TOT_SZ_CVT (FD_METRICS_CONVERTER_NONE)

#define FD_METRICS_COUNTER_EXEC_PROGCACHE_FILL_FAILS_OFF (20UL)
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_FILL_FAILS_NAME "exec_progcache_fill_fails"
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_FILL_FAILS_TYPE (FD_METRICS_TYPE_COUNTER)
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_FILL_FAILS_DESC "Number of program cache load fails (tombstones inserted)"
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_FILL_FAILS_CVT (FD_METRICS_CONVERTER_NONE)

#define FD_METRICS_COUNTER_EXEC_PROGCACHE_DUP_INSERTS_OFF (21UL)
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_DUP_INSERTS_NAME "exec_progcache_dup_inserts"
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_DUP_INSERTS_TYPE (FD_METRICS_TYPE_COUNTER)
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_DUP_INSERTS_DESC "Number of time two tiles raced to insert the same cache entry"
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_DUP_INSERTS_CVT (FD_METRICS_CONVERTER_NONE)

#define FD_METRICS_COUNTER_EXEC_PROGCACHE_INVALIDATIONS_OFF (22UL)
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_INVALIDATIONS_NAME "exec_progcache_invalidations"
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_INVALIDATIONS_TYPE (FD_METRICS_TYPE_COUNTER)
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_INVALIDATIONS_DESC "Number of program cache invalidations"
#define FD_METRICS_COUNTER_EXEC_PROGCACHE_INVALIDATIONS_CVT (FD_METRICS_CONVERTER_NONE)

#define FD_METRICS_EXEC_TOTAL (7UL)
extern const fd_metrics_meta_t FD_METRICS_EXEC[FD_METRICS_EXEC_TOTAL];
10 changes: 10 additions & 0 deletions src/disco/metrics/metrics.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1062,4 +1062,14 @@ metric introduced.
<gauge name="StartSlot" summary="The slot at which the backtest started" />
</tile>

<tile name="exec">
<counter name="ProgcacheMisses" summary="Number of program cache misses" />
<counter name="ProgcacheHits" summary="Number of program cache hits" />
<counter name="ProgcacheFills" summary="Number of program cache insertions" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

split to enum?

ProgCacheInsertResult

  • Success
  • SuccessTombstone
  • Duplicate

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do this and other suggestions discussed in chat in the next PR

<counter name="ProgcacheFillTotSz" summary="Total number of bytes inserted into program cache" />
<counter name="ProgcacheFillFails" summary="Number of program cache load fails (tombstones inserted)" />
<counter name="ProgcacheDupInserts" summary="Number of time two tiles raced to insert the same cache entry" />
<counter name="ProgcacheInvalidations" summary="Number of program cache invalidations" />
</tile>

</metrics>
11 changes: 11 additions & 0 deletions src/disco/topo/fd_topo.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@
#include <unistd.h>
#include <sys/stat.h>

void *
fd_topo_obj_laddr( fd_topo_t const * topo,
ulong obj_id ) {
fd_topo_obj_t const * obj = &topo->objs[ obj_id ];
if( FD_UNLIKELY( obj_id==ULONG_MAX ) ) FD_LOG_CRIT(( "invalid obj_id ULONG_MAX" ));
if( FD_UNLIKELY( obj_id>=FD_TOPO_MAX_OBJS ) ) FD_LOG_CRIT(( "invalid obj_id %lu", obj_id ));
FD_TEST( obj->id == obj_id );
FD_TEST( obj->offset );
return (void *)((ulong)topo->workspaces[ obj->wksp_id ].wksp + obj->offset);
}

void
fd_topo_join_workspace( fd_topo_t * topo,
fd_topo_wksp_t * wksp,
Expand Down
13 changes: 5 additions & 8 deletions src/disco/topo/fd_topo.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ struct fd_topo_tile {
int tx_metadata_storage;
ulong funk_obj_id;
ulong txncache_obj_id;
ulong progcache_obj_id;

char shred_cap[ PATH_MAX ];
char cluster_version[ 32 ];
Expand Down Expand Up @@ -381,6 +382,7 @@ struct fd_topo_tile {
struct {
ulong funk_obj_id;
ulong txncache_obj_id;
ulong progcache_obj_id;

ulong max_live_slots;

Expand Down Expand Up @@ -543,6 +545,7 @@ struct fd_topo_tile {

ulong txncache_obj_id;
ulong funk_obj_id;
ulong progcache_obj_id;
} bank;

struct {
Expand Down Expand Up @@ -643,15 +646,9 @@ fd_topo_workspace_align( void ) {
return 4096UL;
}

static inline void *
void *
fd_topo_obj_laddr( fd_topo_t const * topo,
ulong obj_id ) {
fd_topo_obj_t const * obj = &topo->objs[ obj_id ];
FD_TEST( obj_id<FD_TOPO_MAX_OBJS );
FD_TEST( obj->id == obj_id );
FD_TEST( obj->offset );
return (void *)((ulong)topo->workspaces[ obj->wksp_id ].wksp + obj->offset);
}
ulong obj_id );

/* Returns a pointer in the local address space to the base address of
the workspace out of which the given object was allocated. */
Expand Down
Loading
Loading