hyperlight-dev / hyperlight-dev/hyperlight

Remove legacy heap region from snapshot

Aperta
#1,697 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
area/performance lifecycle/confirmed
Lingua principale
Rust
Stelle
4.7k
Fork
208
Merge medio
1g 7h
PR unite (30g)
47

Descrizione

For historical reasons, we have a "heap" region of memory in the snapshot, which is just a bunch of zero-initialised pages that bound the size of the heap. These are, in theory, never read from, only written to (upon which they will get CoW'd anyway), and have no real purpose existing, but bloat the size of the snapshot image. They are also all distinct physical pages when they are implicitly created in from_env (the space for them is included in `SandboxMemoryLayout::get_memory_size()`, so they are created when we make a memory buffer of that size), so the logic that deduplicates pages by GPA does not even work on them.

We should remove this region, and replace it with a VA region outside the snapshot image region that is unmapped by default, and maps to zero when a fault hits it. We can essentially reuse the logic from the stack region for this.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start by tracing SandboxMemoryLayout::get_memory_size(), the snapshot image region, and the existing stack-region fault handling. The change is complete when the legacy heap pages are absent from snapshots and the replacement out-of-image VA region is unmapped by default but maps to zero on a fault.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
rust
Ambito
infrastructure
Tipo di issue
Refactoring
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.