From 4c546e5d9166a6932e08f654ffd3d628576ce8a1 Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Fri, 31 Oct 2025 09:36:09 +0700 Subject: [PATCH] feat: enable metacopy=on to test metadata-only copy-up Mount OverlayFS with metacopy=on option (kernel 4.2+, supported on ubuntu-22.04). This prevents full file copy-up when files are opened with O_RDWR but not modified. Expected behavior: - ccache opens cache files with write access - OverlayFS creates metadata-only entry in upper layer - Full copy-up only happens if data is actually written - Should dramatically reduce delta sizes from ~324 MB to ~KB Re-enabled use-deltas for ccache to test this optimization. Conan remains base-only (hash-based keys mean exact match most of the time). If successful, deltas should be tiny for cache hit scenarios. --- .github/actions/xahau-actions-cache-restore/action.yml | 7 ++++--- .github/actions/xahau-ga-build/action.yml | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/actions/xahau-actions-cache-restore/action.yml b/.github/actions/xahau-actions-cache-restore/action.yml index 7c1497ecf..a24fab157 100644 --- a/.github/actions/xahau-actions-cache-restore/action.yml +++ b/.github/actions/xahau-actions-cache-restore/action.yml @@ -274,11 +274,12 @@ runs: exit 0 fi - # Mount OverlayFS + # Mount OverlayFS with metacopy=on to prevent copy-up for files opened-but-not-written + # This dramatically reduces delta sizes when ccache opens files with O_RDWR but doesn't modify content echo "" - echo "Mounting OverlayFS..." + echo "Mounting OverlayFS with metacopy=on..." sudo mount -t overlay overlay \ - -o lowerdir="${CACHE_WORKSPACE}/base",upperdir="${CACHE_WORKSPACE}/upper",workdir="${CACHE_WORKSPACE}/work" \ + -o lowerdir="${CACHE_WORKSPACE}/base",upperdir="${CACHE_WORKSPACE}/upper",workdir="${CACHE_WORKSPACE}/work",metacopy=on \ "${CACHE_WORKSPACE}/merged" # Verify mount diff --git a/.github/actions/xahau-ga-build/action.yml b/.github/actions/xahau-ga-build/action.yml index 0816a8f52..10c302e7b 100644 --- a/.github/actions/xahau-ga-build/action.yml +++ b/.github/actions/xahau-ga-build/action.yml @@ -76,7 +76,7 @@ runs: ${{ runner.os }}-ccache-v${{ inputs.cache_version }}-${{ inputs.compiler-id }}-${{ inputs.configuration }}-${{ inputs.main_branch }} ${{ runner.os }}-ccache-v${{ inputs.cache_version }}-${{ inputs.compiler-id }}-${{ inputs.configuration }}- ${{ runner.os }}-ccache-v${{ inputs.cache_version }}-${{ inputs.compiler-id }}- - use-deltas: 'false' # Disabled: OverlayFS file-level deltas incompatible with ccache's byte-level LRU updates + use-deltas: 'true' # Testing: metacopy=on should prevent copy-up for files opened-but-not-written aws-access-key-id: ${{ inputs.aws-access-key-id }} aws-secret-access-key: ${{ inputs.aws-secret-access-key }} @@ -194,6 +194,6 @@ runs: with: path: ~/.ccache key: ${{ runner.os }}-ccache-v${{ inputs.cache_version }}-${{ inputs.compiler-id }}-${{ inputs.configuration }}-${{ steps.safe-branch.outputs.name }} - use-deltas: 'false' # Disabled: OverlayFS file-level deltas incompatible with ccache's byte-level LRU updates + use-deltas: 'true' # Testing: metacopy=on should prevent copy-up for files opened-but-not-written aws-access-key-id: ${{ inputs.aws-access-key-id }} aws-secret-access-key: ${{ inputs.aws-secret-access-key }}