fix(tools): the build gate counts reclaimable page cache as the slice's use

Open
#2,866 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
go, linux

Research direction

Start with tools/internal/buildgate/slice.go, especially sliceReadingFrom, and inspect how the gate records slice_current_mib at each build start. Compare those readings with the slice's anon value from memory.stat during waits. First establish whether cache alone causes waits; if it does, propose and test sizing against anonymous memory with a margin for unreclaimable memory.

Written by the indexing model from the issue text.

Description

backlog

The gate's headroom is memory.high less memory.current, and memory.current counts reclaimable page cache, so a slice full of cache reads as a slice with no room and a build waits for memory the kernel would give back.

Evidence at release/v6.20.0 + the #2844 and #2847 commits

  • tools/internal/buildgate/slice.go sliceReadingFrom reads memory.current only.
  • Read on the slice while builds ran (2026-11-25): anon 4.69 GB and file 6.66 GB of a memory.current of about 11.4 GB (the review of the #2847 commit).
  • The per-job figure MemPerJobMiB is a memory.peak figure, cache included: 543 and 681 MiB a job against 523 and 636 MiB anonymous (slot-build.jsonl peak_mib and anon_peak_mib of two full builds), so the figure is not changed by this.

Not shown

  • How much of the file memory is reclaimable when the gate waits, and how often a build waits on cache alone.

Falsifier

A gate that waits for memory while the slice's anon (memory.stat) is under its limit less the room for 4 jobs starts without waiting once the kernel has reclaimed the cache, or the record shows no wait at those times.

Work

  1. Measure: record anon of the slice beside slice_current_mib at each start and compare waits with it.
  2. If cache is the cause, size against anonymous memory (plus a margin for what the kernel cannot reclaim) with a test first.
Dominant language
C++
Stars
3
Forks
5
Avg merge
4h 37m
Merged PRs (30d)
524

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EchoTools/nevr-runtime

All issues in EchoTools/nevr-runtime

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.