From d58e1d29cc3cbd5f1c9b271c0b7e25b9962fad4f Mon Sep 17 00:00:00 2001 From: eunhhu Date: Sat, 26 Sep 2026 10:46:30 +0100 Subject: Charge lent answers to the payload budget A read answered with extents of the store mapping was charged nothing, so clients that stopped reading could keep any number of old file versions mapped. The runtime core now takes resources a host sends in pieces: body.data is NULL, body.size is charged like any other resource, the outcome has no body to read and cannot be forwarded. pure-serve hands the mapping reference over as such a resource, so a lent answer holds its bytes of budget until it is in the socket and its ticket releases the mapping; past the budget a read gets 503 payload_budget, as a copied one would. The async core grows 52 bytes (5,776 of its 6,144). --- prototypes/connections/runtime.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'prototypes/connections/runtime.h') diff --git a/prototypes/connections/runtime.h b/prototypes/connections/runtime.h index 0add777..70f5d08 100644 --- a/prototypes/connections/runtime.h +++ b/prototypes/connections/runtime.h @@ -20,7 +20,10 @@ typedef enum { PURE_INPUT_READ, PURE_INPUT_WRITE } PureInput; /* The host owns this resource until it successfully returns it to the core. * release must end all access and free/unmap allocation exactly once. It runs - * while that domain is busy; calls back into the same domain are rejected. */ + * while that domain is busy; calls back into the same domain are rejected. + * A resource the host sends in pieces (such as extents of a mapping) has no + * contiguous body: body.data is NULL and body.size is still what it holds and + * is charged. Its outcome has no body to read and cannot be forwarded. */ typedef struct { PureSpan body; void *allocation; -- cgit v1.2.3