Skip to content

fix(filecow): bound unchanged snapshot layer growth - #3

Open
yiying-zhang wants to merge 65 commits into
mainfrom
fix/filecow-layer-lifetime
Open

fix(filecow): bound unchanged snapshot layer growth#3
yiying-zhang wants to merge 65 commits into
mainfrom
fix/filecow-layer-lifetime

Conversation

@yiying-zhang

Copy link
Copy Markdown
Collaborator

This PR addresses the known memory-leak issue.

Summary

  • avoid allocating filecow generations when a mapping has no private state to
    preserve;
  • reuse the current immutable layer for unchanged child mappings;
  • defer layer allocation until Btrfs extent shareability is known, avoiding
    empty generations for unshareable cache;
  • expose filecow lifetime counters in /proc/filecow_stats; and
  • add a repeated Btrfs snapshot lifetime selftest.

This fixes unbounded layer-chain growth observed across repeated unchanged
container forks. It intentionally does not change tfork userspace cleanup or
latency coordination.

Validation

  • booted kernel 7.0.1-filecowfix-pgcachecow #4;
  • 100-iteration Btrfs kernel selftest passed;
  • 20 isolated live container forks passed inheritance and source/child
    divergence checks;
  • 120 inode-level forks left layers_allocated and layers_active flat at 3;
  • 100-cycle and 1,000-cycle combined-stack soaks run separately in the final
    integration gate.

Safety

  • retains layers while inode/mapping owners remain cached;
  • changes allocation/reuse, not page ownership or write-COW semantics;
  • preserves the previous kernel in GRUB as a recovery fallback.

yiying-zhang and others added 30 commits July 10, 2026 23:44
Stabilize live tfork source freezing
yiying-zhang and others added 28 commits July 18, 2026 10:08
…-main

Stabilize single-copy tfork clone path
Rewrite tclone setup for Gensee Crate
@yiying-zhang yiying-zhang changed the title Fix/filecow layer lifetime fix(filecow): bound unchanged snapshot layer growth Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants