hyperlight-dev / hyperlight-dev/hyperlight

Heuristic-based scratch zeroing strategy for snapshot restore

Đang mở
#1,766 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
lifecycle/needs-review
Ngôn ngữ chính
Rust
Star
4.7k
Fork
208
Merge trung bình
1 ngày 7 giờ
Pull request đã merge (30 ngày)
47

Mô tả

`HostSharedMemory::zero_or_replace()` currently uses a compile-time `#[cfg(target_os = "windows")]` check to decide whether to zero scratch in-place or replace it with a fresh demand-zero allocation. This works for the immediate problem (large scratch regions on WHP), but the real decision depends on the hypervisor and the size of the region, not just the platform.

There is a break-even point between zero-in-place (via `MADV_DONTNEED` or `fill(0)`) and delete+recreate (fresh `ExclusiveSharedMemory::new`) that varies by:
- Hypervisor (KVM, MSHV, WHP)
- Scratch region size
- Whether `MADV_DONTNEED` is available (KVM-only builds vs KVM+mshv3)

We should benchmark across these configurations and replace the compile-time platform check with a size-based heuristic. This would also allow MSHV builds on Linux to benefit from the fresh-allocation path for large scratch regions.

Ref: #1765

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start with HostSharedMemory::zero_or_replace() and read the context in #1765. Benchmark zero-in-place versus delete-and-recreate across KVM, MSHV, and WHP, varying scratch-region sizes and MADV_DONTNEED availability. Done means the compile-time Windows check is replaced by a size-based heuristic that also benefits large scratch regions in MSHV Linux builds.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
rust
Lĩnh vực
infrastructure, performance
Loại issue
Tái cấu trúc
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.