hyperlight-dev / hyperlight-dev/hyperlight

Remove legacy heap region from snapshot

Ouverte
#1,697 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
area/performance lifecycle/confirmed
Langage dominant
Rust
Étoiles
4.7k
Forks
208
Merge moyen
1 j 7 h
PR mergées (30 j)
47

Description

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.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
rust
Domaine
infrastructure
Type d'issue
Refactorisation
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
48/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.