mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
This option, enabled via `runsc checkpoint --exclude-committed-zero-pages`, instructs `pgalloc.MemoryFile.SaveTo()` to also exclude definitely-committed zero pages from checkpointing (in addition to possibly-committed zero pages, which are always scanned for and excluded). This is useful when the application being checkpointed is known to have a large number of committed zero pages: pages that (1) have been touched by application memory accesses, a syscall such as read(), or page pinning by e.g. a driver, and (2) have not been subsequently released by the application to the operating system by e.g. munmap() or madvise(MADV_DONTNEED) (+ page unpinning if necessary), and (3) are filled with zero bytes. Minor changes: - In `MemoryFile.updateUsageLocked()`, pass file offset to `checkCommitted` so that `MemoryFile.SaveTo()`'s `checkCommitted` can use `FALLOC_FL_PUNCH_HOLE` to decommit pages rather than `MADV_REMOVE` (which translates addresses to file offsets and then invokes `FALLOC_FL_PUNCH_HOLE`). - In `MemoryFile.SaveTo()`, buffer up to a hugepage worth of pages to decommit rather than decommitting one page per syscall. - Increment `MemoryFile.usageExpected` in `MemoryFile.LoadFrom()`, such that the first following call to `MemoryFile.UpdateUsage()` might skip the call to `MemoryFile.updateUsageLocked()` (if memory usage hasn't changed since loading). PiperOrigin-RevId: 632370455
32 lines
718 B
Python
32 lines
718 B
Python
load("//tools:defs.bzl", "go_library")
|
|
|
|
package(
|
|
default_applicable_licenses = ["//:license"],
|
|
licenses = ["notice"],
|
|
)
|
|
|
|
go_library(
|
|
name = "state",
|
|
srcs = [
|
|
"state.go",
|
|
"state_metadata.go",
|
|
"state_unsafe.go",
|
|
],
|
|
visibility = ["//pkg/sentry:internal"],
|
|
deps = [
|
|
"//pkg/abi/linux",
|
|
"//pkg/context",
|
|
"//pkg/errors/linuxerr",
|
|
"//pkg/fd",
|
|
"//pkg/log",
|
|
"//pkg/sentry/inet",
|
|
"//pkg/sentry/kernel",
|
|
"//pkg/sentry/pgalloc",
|
|
"//pkg/sentry/time",
|
|
"//pkg/sentry/vfs",
|
|
"//pkg/sentry/watchdog",
|
|
"//pkg/state/statefile",
|
|
"@org_golang_x_sys//unix:go_default_library",
|
|
],
|
|
)
|