Skip to content

0.24.2: avoid unrelated RSS reads during unit memory observation - #50

Merged
Sunrisepeak merged 1 commit into
mainfrom
perf/unit-membership-probe
Nov 5, 2026
Merged

Sunrisepeak merged 1 commit into
mainfrom
perf/unit-membership-probe

Conversation

@Sunrisepeak

@Sunrisepeak Sunrisepeak commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

The unit memory observer opens /proc/<pid>/stat for every visible process before discarding records from unrelated process groups. An image compiler worker starts this observer for its own supervised unit, multiplying the unrelated record reads across short-lived workers.

Query each visible PID's process group first. A successful mismatch skips its RSS record; a failed query retains the existing record-reading path, and potential members still have their group checked in the same record used for RSS. Keep complete process-group membership, immediate initial sampling, the 100/200/500 ms cadence, summed memory and whole-unit termination. The C surface and resource properties are unchanged. Prepare package 0.24.2 and align the usage example and observation description.

Validation:

  • Actual public kal_process_job_usage controls cover unrelated groups, siblings joining/leaving and surviving members after the leader exits. EPERM and ENOSYS seccomp controls retain exact membership and memory through the fallback.
  • Actual kal_process_job_limit/task/memory implementation controls terminate both non-leader members when their sum exceeds the ceiling, including both denied-query controls; an unrelated unit survives. No single-member shortcut or delayed first observation.
  • At 37 visible processes and two group members, one observation's RSS record opens fall from 37 to 2. Twelve alternating component pairs give median CPU ratio 0.244.
  • Same frozen a139 clangd bundle, identical compiler/profile runner builds, original 304-unit/three-file/176-worker cold workload: eight alternating pairs give median cold CPU 5.600s versus 5.385s (ratio 0.962). Readiness medians are 3.880s versus 4.034s, so no readiness improvement is established. Individual CPU pairs vary. All semantic sessions pass. This local diagnostic does not qualify either original Linux CI gate or promote the engine ledger.
  • Clang 18 freestanding x86_64 and AArch64 compilation and git diff --check pass. Full repository CI remains the merge gate.

Part of the remaining performance diagnosis for mcpp-community/mcpp#885. Publication and downstream adoption follow successful checks and exact-host workload evidence; no release is claimed by this PR.

@Sunrisepeak
Sunrisepeak merged commit 59a3a59 into main Nov 5, 2026
2 checks passed
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.

1 participant