diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a37a836dbd8..cc27351d5d0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,11 @@ name: CI "on": workflow_dispatch: + inputs: + checkpoint_version: + description: 'Compatible checkpoint commit (12 hex digits; empty uses source revision)' + required: false + type: string push: branches: - "*" @@ -25,9 +30,12 @@ jobs: uses: actions/checkout@v5 - name: build + env: + CHECKPOINT_VERSION: ${{ inputs.checkpoint_version }} run: | mkdir -p bin - make copy TARGETS=runsc DESTINATION=bin/ + [[ -z "$CHECKPOINT_VERSION" || "$CHECKPOINT_VERSION" =~ ^[0-9a-f]{12}$ ]] + make copy TARGETS=runsc DESTINATION=bin/ BAZEL_OPTIONS="--workspace_status_command='tools/workspace_status.sh $CHECKPOINT_VERSION'" - name: Upload runsc uses: actions/upload-artifact@v4 diff --git a/pkg/sentry/pgalloc/pgalloc.go b/pkg/sentry/pgalloc/pgalloc.go index 7c01cf7edd3..7125680331b 100644 --- a/pkg/sentry/pgalloc/pgalloc.go +++ b/pkg/sentry/pgalloc/pgalloc.go @@ -1479,6 +1479,9 @@ func (f *MemoryFile) AdviseHugepageRanges(ranges []memmap.FileRange) error { } func (f *MemoryFile) adviseHugepageRanges(ranges []memmap.FileRange) { + if !f.opts.ExpectHugepages { + return + } warned := false for _, fr := range ranges { f.forEachMappingSlice(fr, func(bs []byte) { diff --git a/pkg/sentry/state/stateio/pagesfile.go b/pkg/sentry/state/stateio/pagesfile.go index e65aae1fccc..df6f67f6b08 100644 --- a/pkg/sentry/state/stateio/pagesfile.go +++ b/pkg/sentry/state/stateio/pagesfile.go @@ -21,6 +21,9 @@ import ( const ( pagesFileFDDefaultMaxIOBytes = 256 << 10 pagesFileFDDefaultMaxParallel = 128 + // Keep 32 MiB in flight with fewer threads faulting restored shmem pages. + pagesFileFDDefaultMaxReadBytes = 4 << 20 + pagesFileFDDefaultMaxReadParallel = 8 ) // NewPagesFileFDReader returns a FDReader that reads a pages file from the @@ -39,7 +42,7 @@ func NewPagesFileFDReader(fd int32, maxReadBytes uint64, maxParallel int) *FDRea // the given host file descriptor, using defaults for MaxReadBytes and // MaxParallel. It takes ownership of the file descriptor. func NewPagesFileFDReaderDefault(fd int32) *FDReader { - return NewPagesFileFDReader(fd, pagesFileFDDefaultMaxIOBytes, pagesFileFDDefaultMaxParallel) + return NewPagesFileFDReader(fd, pagesFileFDDefaultMaxReadBytes, pagesFileFDDefaultMaxReadParallel) } // NewPagesFileFDWriter returns a FDWriter that writes a pages file to the diff --git a/tools/workspace_status.sh b/tools/workspace_status.sh index 62d78ed3d30..465a501525f 100755 --- a/tools/workspace_status.sh +++ b/tools/workspace_status.sh @@ -15,4 +15,4 @@ # limitations under the License. # The STABLE_ prefix will trigger a re-link if it changes. -echo STABLE_VERSION "$(git describe --always --tags --abbrev=12 --dirty 2>/dev/null || echo 0.0.0)" +echo STABLE_VERSION "${1:-$(git describe --always --tags --abbrev=12 --dirty 2>/dev/null || echo 0.0.0)}"