Skip to content

fix(slab): the guard watches memcg-attributed truth, not the drifting counter - #348

Merged
rldyourmnd merged 1 commit into
mainfrom
fix/slab-guard-watches-attributed-truth
Sep 1, 2026
Merged

fix(slab): the guard watches memcg-attributed truth, not the drifting counter#348
rldyourmnd merged 1 commit into
mainfrom
fix/slab-guard-watches-attributed-truth

Conversation

@rldyourmnd

Copy link
Copy Markdown
Contributor

Closes #264 with a diagnosis instead of a wait: the "leak" is kernel accounting drift, not occupied memory.

Measured on gha-runner-2 (6.8.0-138, 20h uptime): meminfo SUnreclaim = 1041 MiB; root cgroup memory.stat slab_unreclaimable = 44 MiB; per-cache sums (objects and pages, unreclaimable-flagged via /sys/kernel/slab) ≈ 220 MiB; drop_caches=2 freed 486 MiB of SReclaimable and moved the counter by 0; per-cache shrink moved it by 0; 361 dying memcgs neither popped nor pinned it. The global counter drifts under container churn — the healer was rebooting members daily to reset an integer.

Change: compliance observer exports both views (gha_fleet_host_slab_unreclaimable_counter_bytes + _attributed_bytes, -1 when unavailable); slab-heal prefers the attributed value (helper + parser pinned by tests, source named in the heal reason, meminfo fallback for non-cgroup-v2 hosts); kernel_slab_unreclaimable alert watches the attributed gauge (metric contract test updated); maintenance-windows runbook records the story. Reboot healing stays armed for genuine growth.

https://claude.ai/code/session_01LsGid6U5RrQdFvJmvYdGCF

… counter

Diagnosed live on runner-2: /proc/meminfo SUnreclaim said 1041 MiB while
the root cgroup's memory.stat attributed 44 MiB, and the ~1 GiB gap was
unattributable to any live cache -- per-cache sums reached ~220 MiB --
and immune to drop_caches=2 (VFS caches fell 486 MiB, the counter did not
move) and to per-cache shrink. The global NR_SLAB_UNRECLAIMABLE counter
drifts under container churn on 6.8.0-138; the memory it reports is not
occupied. The healer was rebooting members daily to reset an integer, and
the alert paged on the same phantom.

The compliance observer now exports both views side by side
(slab_unreclaimable_counter_bytes / _attributed_bytes), slab-heal prefers
the attributed value when cgroup v2 exposes it and names its source in
the heal reason, and kernel_slab_unreclaimable watches the attributed
gauge. The reboot path stays armed for genuine slab growth.

Closes #264

Claude-Session: https://claude.ai/code/session_01LsGid6U5RrQdFvJmvYdGCF
@rldyourmnd
rldyourmnd merged commit d5c55a0 into main Sep 1, 2026
10 checks passed
@rldyourmnd
rldyourmnd deleted the fix/slab-guard-watches-attributed-truth branch September 1, 2026 16:53
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.

kernel slab leak persists on the fixed kernel, ~25-48 MiB/h per compute member

1 participant