criu: parallelize independent root siblings during TClone restore - #15
Open
yiying-zhang wants to merge 70 commits into
Open
criu: parallelize independent root siblings during TClone restore#15yiying-zhang wants to merge 70 commits into
yiying-zhang wants to merge 70 commits into
Conversation
Stabilize live tfork source freezing
…-main Stabilize single-copy tfork clone path
Rewrite tclone setup for Gensee Crate
Clarify Gensee tclone host setup
Initialize temporary CRIU process UIDs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CRIU_TFORK_PARALLEL_SIBLINGS=Nrestore path;clone3(set_tid)plus syscall-onlyCLONE_PARENTto preserve requestedPIDs and the restored parent graph;
0an explicit off value for exact-binary ablation.Why
At 100 processes, profiling measured about 166.96 ms per run in
fork_with_pid(), including 155.75 ms inclone3. Kernel sampling assignedmost sampled
copy_process()time todup_mmap(). CRIU currently launchesroot siblings serially even though their Linux task creation is independent.
This change overlaps that real kernel and restore initialization work instead
of optimizing another small image-decoding or procfs leaf.
Safety scope
The fast path is disabled by default and requires:
clone3(set_tid)support;CLONE_PARENT,CLONE_NEWPID,CLONE_VM, orCLONE_THREADrequirements.Worker count is capped at 16. Nested restore tasks stay serial, so wide nested
trees cannot recursively multiply helper pools. The restore root blocks
SIGCHLD, reaps every temporary helper, and fails restore if any helper fails.An ineligible group falls back before any parallel work begins.
Performance
The A/B used the exact same Podman, crun, libcriu, and CRIU files. Only
CRIU_TFORK_PARALLEL_SIBLINGS=0versus8changed. Every run used a freshsource, alternating AB/BA order, and a one-second idle cooldown.
At 100 processes, the internal Phase-B-marker-to-clone-tree median fell from
343.010 to 227.406 ms, with 118.879 ms paired-median saving. A median fit
over all six points changes from 6.231 to 5.117 ms/process for this synthetic
workload.
Validation
criu check --allreportsLooks good.;flat parent graph;
relationships;
Known limitations
The branch is intentionally opt-in pending nested PID-namespace,
shared-VM/thread-group, helper-failure-injection, concurrency, and long-soak
coverage. Three exploratory runs also hit the pre-existing 60-second
event-readiness timeout—two serial and one parallel. Transactional rollback
cleaned each unpublished child. This branch does not attempt to hide or retry
that separate reliability issue.