demikernel icon indicating copy to clipboard operation
demikernel copied to clipboard

Allow demi_sgaalloc calls larger than 64KB

Open kyleholohan opened this issue 2 years ago • 0 comments

Context

The demi_sgaalloc API uses the LibOS's sgaalloc provider to allocate memory. Most (all?) LibOSes currently use MemoryRuntime to handle these sgaalloc calls. This implementation will fail allocations where the size parameter is greater than u16::MAX, as the code is not currently situated to allocate more than one DemiBuffer (the DemiBuffer length field is 16 bytes).

This limitation potentially requires clients to juggle multiple independent buffers, which could unnecessarily complicate client-side logic.

See also #88 (outdated)

Proposed Solution

Update MemoryRuntime's sgaalloc implementation to chain buffers to reach the desired allocation iota. Useful support will subsequently require changes to each LibOS to accept chained DemiBuffers.

Alternative Solutions

Allocation sizes could be limited to 16 bits as a formal contract, but this seems very artificially limiting versus other software.

kyleholohan avatar Jan 18 '24 20:01 kyleholohan