diff options
| author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2026-06-01 08:41:34 +0200 |
|---|---|---|
| committer | Sander Vrijders <sander@ouroboros.rocks> | 2026-06-03 08:02:34 +0200 |
| commit | bdfea870024b8efd0a0bd16f8978482d8bbf9ed9 (patch) | |
| tree | 74871a873dd49cb35fe3390b241638286621b86f /src/lib/ssm/ssm.h.in | |
| parent | b88c120f68b0e9f779fa0071a2ad095b93d5aaf6 (diff) | |
| download | ouroboros-bdfea870024b8efd0a0bd16f8978482d8bbf9ed9.tar.gz ouroboros-bdfea870024b8efd0a0bd16f8978482d8bbf9ed9.zip | |
lib: Reclaim aged leaked ssm pool blocks
The reclaim_pid_from_sc() function reaped any block allocated with
refcount from a dead PID, but cross-process hand-offs can leave a
block briefly allocated by the producer while a live consumer still
holds it. This skips reclaim within SSM_POOL_RECLAIM_AGE_S (default
60s) so in-flight hand-offs survive a producer crash.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/lib/ssm/ssm.h.in')
| -rw-r--r-- | src/lib/ssm/ssm.h.in | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/ssm/ssm.h.in b/src/lib/ssm/ssm.h.in index b86327a1..57febae4 100644 --- a/src/lib/ssm/ssm.h.in +++ b/src/lib/ssm/ssm.h.in @@ -83,6 +83,7 @@ /* Size class configuration */ #define SSM_POOL_MAX_CLASSES 9 #define SSM_POOL_SHARDS @SSM_POOL_SHARDS@ +#define SSM_POOL_RECLAIM_AGE_S @SSM_POOL_RECLAIM_AGE_S@ /* Internal structures - exposed for testing */ #ifdef __cplusplus @@ -125,6 +126,7 @@ struct ssm_pk_buff { uint32_t pk_head; /* Head offset into data */ uint32_t pk_tail; /* Tail offset into data */ uint32_t off; /* Block offset in pool */ + uint64_t alloc_ts; /* CLOCK_MONOTONIC ns at alloc */ uint8_t data[]; /* Packet data */ }; |
