hyperlight-dev / hyperlight-dev/hyperlight

Remove legacy heap region from snapshot

オープン
#1,697 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
area/performance lifecycle/confirmed
主要言語
Rust
スター
4.7k
フォーク
208
平均マージ
1日 7時間
マージ済み PR(30日)
47

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
rust
領域
infrastructure
issue の種類
リファクタリング
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。