← Back to Pull requests

Improve cost of container commit #1216

Open
unknown opened this pull request with 248 lines diff across 3 files
View on GitHub
unknown unknown commented on Sep 29, 2026 21:07 UTC
Author

The recent security fixes, in addition to the core write escapes, also switched to use os.Root for creating tar archives. Because os.Root resolves deeply nested paths one directory at a time, that is more costly, particularly with FUSE. Improve some of that performance again.

  • Move the stat and xattr abstractions from pkg/system to internal/…. We just added public stat.RootL… and they are now unused, so let’s not make that mistake again.

  • Avoid some wholly redundant root.Lstat calls when the data is already provided by fs.WalkDir()

  • When using *os.Root, instead using a single root at the top level (paying the cost of the directory walk on each operation), create also a per-directory parentRoot and do all operations only on base names. The current plan in Go is to replace the directory walk with a single openat2 syscall, but they would still do a separate syscall for the actual operation; so, using a parentRoot, we can eliminate (currently) the directory walk and (in the future) the openat2.

  • Because most of our operations don’t control the walk directly and obtain individual path names, introduce internal/rootlookupcache, so that consecutive operations on files in the same directory don’t need to open the directory repeatedly.

  • For the Linux Changes… operation, where we are doing the directory walk manually, also use the cache and use basename-only operations.

  • Operations on xattrs need an O_PATH or similar handle of the individual file. Instead of creating that for each syscall, manage the lifetime explicitly as an xattr.Handle.
  • This is not ideal, but to do better we’d need to wholly replace fs.WalkDir, with something more complex (e.g. keeping the last 10 or so parent handles). That can still be done in the future; and if it eliminates the need of rootlookupcache`, we can just drop it again.

    Mostly mitigates https://github.com/podman-container-tools/podman/issues/29833 , see there for some numbers.

    Diff: 248 lines (+186 / -62) across 3 files Reviewer: mtrmac Review duration: 10816m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.39) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 248 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.330
    Real PR Conversation Timeline
    1 comments
    "Review active on #1216"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 38.9% (MEDIUM) · Higher = larger blast radius
    38.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.8% · Safe to merge
    20.8%