Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
e0761c6
Merge pull request #1 from GenseeAI/fix/fork-synchronization
yiying-zhang Jul 11, 2026
c422f42
Update README.md
yiying-zhang Jul 11, 2026
3f989ff
Use direct crun path for single-copy tfork
yiying-zhang Jul 17, 2026
8001ff4
Expand tfork CRIU failure logs
yiying-zhang Jul 17, 2026
d682a64
Include tfork restore log on CRIU failure
yiying-zhang Jul 17, 2026
f9400ac
Avoid PID namespace collision in tfork ncopy
yiying-zhang Jul 17, 2026
71a23f1
Preserve PID hierarchy during tfork restore
yiying-zhang Jul 17, 2026
ead824f
Insert pstree PIDs after loading namespace IDs
yiying-zhang Jul 17, 2026
bac21f9
Fix tfork nested pid namespace ids
yiying-zhang Jul 17, 2026
c952db9
Avoid tfork freezer wait timeout on transient tasks
yiying-zhang Jul 17, 2026
3dea3a7
Recompute invalid tfork nested pid namespace cache
yiying-zhang Jul 17, 2026
88fef5e
Force nested pid leaf ids during tfork dump
yiying-zhang Jul 17, 2026
d838fca
Finalize nested pid namespace ids before pstree dump
yiying-zhang Jul 17, 2026
852c991
Avoid ncopy helper consuming restored pid 1
yiying-zhang Jul 17, 2026
9f2fb9f
Drop source pid chain for tfork restore copies
yiying-zhang Jul 17, 2026
7d87562
Rebase nested tfork restore pid chains
yiying-zhang Jul 18, 2026
98c2360
Force pid hierarchy truncation for tfork restores
yiying-zhang Jul 18, 2026
d35c693
Use fresh parent pids for tfork pidns inits
yiying-zhang Jul 18, 2026
3d108b0
Repair tfork pidns init clone flags
yiying-zhang Jul 18, 2026
13767ad
Use fresh parent tids for tfork thread restore
yiying-zhang Jul 18, 2026
d2b35f3
Allow fresh tfork thread tids
yiying-zhang Jul 18, 2026
7ee5852
Log tfork restore stage aborts
yiying-zhang Jul 18, 2026
2ced506
Fix restore abort diagnostic build
yiying-zhang Jul 18, 2026
e04c1d7
Tolerate clean child exits during tfork restore
yiying-zhang Jul 18, 2026
c1d28a7
Make CRIU module loading idempotent
yiying-zhang Jul 18, 2026
c862f96
Avoid fatal log for clean tfork child exits
yiying-zhang Jul 18, 2026
2358325
Default tfork single-copy to direct crun
yiying-zhang Jul 18, 2026
6363d89
Make tfork clone readiness timeout configurable
yiying-zhang Jul 18, 2026
8b0cbd9
Use n-copy restore for single-copy tfork clones
yiying-zhang Jul 18, 2026
5b77814
Allow external unix sockets during tfork
yiying-zhang Jul 18, 2026
ba94887
Propagate ext unix socket option to tfork
yiying-zhang Jul 18, 2026
7693c32
Skip inotify mark replay for tfork restores
yiying-zhang Jul 18, 2026
6a14400
Add tfork restore stage timeout diagnostics
yiying-zhang Jul 18, 2026
176d7f2
Log tfork restore stage participants
yiying-zhang Jul 18, 2026
e8426fd
Trace tfork leader restore stalls
yiying-zhang Jul 18, 2026
eb724fd
Avoid tfork zombie wait deadlock
yiying-zhang Jul 19, 2026
23eebc2
Address tfork review robustness
yiying-zhang Jul 20, 2026
c36af32
Address tfork single-copy review follow-ups
yiying-zhang Jul 20, 2026
98e5219
Fix tfork pstree unwind bounds
yiying-zhang Jul 20, 2026
b1416e6
Fix tfork pstree cleanup ownership
yiying-zhang Jul 20, 2026
4292aec
Fix tfork clone behavioral gaps
yiying-zhang Jul 20, 2026
fec9257
Harden tfork review follow-ups
yiying-zhang Jul 20, 2026
2383444
Merge pull request #2 from GenseeAI/fix/tfork-single-copy-direct-crun…
yiying-zhang Jul 20, 2026
64e913f
Rewrite tclone setup for Gensee Crate
yiying-zhang Jul 22, 2026
2eb459e
Merge pull request #3 from GenseeAI/docs/gensee-crate-readme
yiying-zhang Jul 22, 2026
90409b1
Clarify Gensee tclone setup
yiying-zhang Jul 24, 2026
2332885
Fix tclone kernel and image setup docs
yiying-zhang Jul 25, 2026
7834642
Merge pull request #4 from GenseeAI/agent/readme-tclone-setup
yiying-zhang Jul 25, 2026
6dcbf2e
Initialize temporary CRIU process UIDs
shengqi-gensee Jul 29, 2026
29fe65c
Initialize complete temporary PID state
shengqi-gensee Jul 29, 2026
903e577
Merge pull request #5 from GenseeAI/agent/init-temporary-pid-uids
yiying-zhang Jul 29, 2026
d12e37d
selftests: cover filecow layer lifetime
yiying-zhang Jul 31, 2026
6bfc93f
refactor(filecow): scan private state once
yiying-zhang Jul 31, 2026
e5082ca
selftests: support older btrfs-progs
yiying-zhang Jul 31, 2026
2eb1ee8
fix(filecow): skip empty generations for unshareable cache
yiying-zhang Jul 31, 2026
cce7943
style: normalize filecow fast-path patch
yiying-zhang Jul 31, 2026
7bd2f23
cleanup: remove obsolete filecow install label
yiying-zhang Jul 31, 2026
e7d5c44
docs: describe bounded filecow layer lifetime
yiying-zhang Jul 31, 2026
2801263
test(tfork): exercise rollback fault boundaries
yiying-zhang Jul 31, 2026
a8267db
test(tfork): add Phase B A/B benchmark
yiying-zhang Jul 31, 2026
0ffd017
perf(tfork): default to nftables network locking
yiying-zhang Jul 31, 2026
f675a71
test(tfork): benchmark network lock backends
yiying-zhang Jul 31, 2026
394f869
fix(tfork): keep network locking mandatory
yiying-zhang Jul 31, 2026
d394136
test(tfork): reject unlocked live clones
yiying-zhang Jul 31, 2026
46d7e1a
perf(tfork): add opt-in residual latency probes
yiying-zhang Jul 31, 2026
753459b
tfork: overlap socket purge with phase A
yiying-zhang Jul 31, 2026
330039f
fix(filecow): harden snapshot shareability scan
yiying-zhang Aug 1, 2026
808bebc
style: align filecow bulk hook call
yiying-zhang Aug 1, 2026
28f6c6b
fix(tfork): verify external clone pid identity
yiying-zhang Aug 1, 2026
7b071bd
test(tfork): initialize embedded clone config
yiying-zhang Aug 1, 2026
ea5297d
perf(tfork): wake restore barriers with futex
yiying-zhang Jul 31, 2026
22652f0
perf(tfork): return clone metadata with live clone
yiying-zhang Aug 1, 2026
67fc124
perf(tfork): inject clone files before publication
yiying-zhang Aug 1, 2026
bc2c6bd
perf(tfork): parallelize root sibling creation
yiying-zhang Aug 1, 2026
e8bc31c
perf(tfork): honor runtime CRIU log level
yiying-zhang Aug 1, 2026
46db440
fix(filecow): bound unchanged fork layer growth
yiying-zhang Jul 31, 2026
14930bd
fix(tfork): harden residual profile timestamps
yiying-zhang Aug 2, 2026
0fefdb3
tfork: scope source sync to backing filesystem
yiying-zhang Jul 31, 2026
526baa1
fix(tfork): fail clone on overlapped socket purge error
yiying-zhang Aug 2, 2026
a83dbc6
tfork: replace readiness polling with runtime events
yiying-zhang Jul 31, 2026
26a9571
docs(tfork): clarify injected file ownership
yiying-zhang Aug 3, 2026
704acf8
perf(tfork): inject source files while frozen
yiying-zhang Aug 1, 2026
a424994
fix(tfork): define durable source rotation semantics
yiying-zhang Aug 3, 2026
0ed66bc
podman: add opt-in local tfork API
yiying-zhang Aug 1, 2026
a292955
criu: restore pid-hierarchy truncation on tfork restore
dothyt Aug 5, 2026
4f9428c
criu: fix restore of a zombie init of a nested pid namespace
dothyt Aug 5, 2026
9704d29
fix(tfork): make clone setup transactional
yiying-zhang Jul 31, 2026
85d1f7c
Merge WukLab main and preserve filecow lifetime documentation
dothyt Aug 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ check [agent-s README](agents/agent-s/README.md)
- btrfs only
- rootful only
- amd64 only
- linux page-cache CoW currently has a memory leak that will be fixed
- Filecow layers are reclaimed with their cached inode/mapping owners rather
than eagerly when a child is deleted. Repeated unchanged forks reuse the
current layer, so retained layers are bounded by changed generations instead
of the total fork count.

## License

Expand Down
23 changes: 18 additions & 5 deletions criu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,25 @@ for mod in "${ACTIVE_MODULES[@]}"; do
fi

if lsmod | awk '{print $1}' | grep -qx "${mod}"; then
echo " -- ${mod}: already loaded, rmmod then insmod"
rmmod "${mod}" 2>/dev/null || true
else
echo " -- ${mod}: insmod"
echo " -- ${mod}: already loaded, trying reload"
if ! rmmod "${mod}"; then
echo "build.sh: failed to unload loaded module ${mod}; aborting to avoid stale module" >&2
echo "build.sh: stop running tfork/podman containers that may still hold ${mod}, then retry" >&2
exit 1
fi
if lsmod | awk '{print $1}' | grep -qx "${mod}"; then
echo "build.sh: module ${mod} is still loaded after rmmod; aborting to avoid stale module" >&2
echo "build.sh: stop running tfork/podman containers that may still hold ${mod}, then retry" >&2
exit 1
fi
fi

echo " -- ${mod}: insmod"
if ! insmod "${ko_path}"; then
echo "build.sh: failed to insert rebuilt module ${mod} from ${ko_path}" >&2
echo "build.sh: if the old module is still active, stop running tfork/podman containers and rerun this script" >&2
exit 1
fi
insmod "${ko_path}"
done

echo " -- verify all modules loaded"
Expand Down
3 changes: 3 additions & 0 deletions criu/criu/action-scripts.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ static const char *action_names[ACT_MAX] = {
[ACT_ORPHAN_PTS_MASTER] = "orphan-pts-master",
[ACT_STATUS_READY] = "status-ready",
[ACT_QUERY_EXT_FILES] = "query-ext-files",
[ACT_POST_TFORK_FREEZE] = "post-tfork-freeze",
[ACT_PRE_TFORK_RESTORE] = "pre-tfork-restore",
[ACT_TFORK_SOURCE_DETACHED] = "tfork-source-detached",
};

struct script {
Expand Down
16 changes: 16 additions & 0 deletions criu/criu/clone-noasan.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ int clone3_with_pid_noasan(int (*fn)(void *), void *arg, int flags, int exit_sig
c_args.flags = flags;
c_args.set_tid = ptr_to_u64(&pid);
c_args.set_tid_size = 1;
pr_info("clone3 set_tid pid=%d flags=0x%x size=1\n", pid, flags);
pid = syscall(__NR_clone3, &c_args, sizeof(c_args));
if (pid < 0)
pr_perror("clone3 set_tid failed flags=0x%x size=1", flags);
if (pid == 0)
exit(fn(arg));
return pid;
Expand All @@ -99,6 +102,12 @@ int clone3_with_nested_pid_noasan(int (*fn)(void *), void *arg, int flags, int e
BUG_ON(pid->ns_level > MAX_PID_NS_LEVEL || pid->ns_level <= 1);
for (i = 0; i < pid->ns_level; i++)
tids[i] = pid->ns[i].ns_pid;
pr_info("clone3 nested set_tid flags=0x%x size=%d tids=%d/%d/%d/%d\n",
flags, pid->ns_level,
tids[0],
pid->ns_level > 1 ? tids[1] : -1,
pid->ns_level > 2 ? tids[2] : -1,
pid->ns_level > 3 ? tids[3] : -1);

if (!(flags & CLONE_PARENT)) {
if (exit_signal != SIGCHLD) {
Expand All @@ -112,6 +121,13 @@ int clone3_with_nested_pid_noasan(int (*fn)(void *), void *arg, int flags, int e
c_args.set_tid = ptr_to_u64(tids);
c_args.set_tid_size = pid->ns_level;
pid_ret = syscall(__NR_clone3, &c_args, sizeof(c_args));
if (pid_ret < 0)
pr_perror("clone3 nested set_tid failed flags=0x%x size=%d tids=%d/%d/%d/%d",
flags, pid->ns_level,
tids[0],
pid->ns_level > 1 ? tids[1] : -1,
pid->ns_level > 2 ? tids[2] : -1,
pid->ns_level > 3 ? tids[3] : -1);
if (pid_ret == 0)
exit(fn(arg));
return pid_ret;
Expand Down
Loading