…f, file errors)
- A failed read of cgroup.controllers or the v1 root memory.stat no longer
reads as "no container": cgroup is "unreadable", so available memory and
cores are null (never the host's numbers).
- The cgroup v2 root's memory.max and cpu.max are read whenever they exist,
so a container with systemd inside is capped too; /proc/self/cgroup is no
longer read. A real host's root has no such files.
- PSI built in but turned off (EOPNOTSUPP) reads as "no PSI" for the machine;
everywhere else it stays a failed read.
- capacityFileError sorts the real host's file errors, tested code by code
(every error read as missing no longer passes).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Loading branch information
Uh oh!
There was an error while loading. Please reload this page.
| total, available | `/proc/meminfo` MemTotal, MemAvailable (kB); in a container (namespace root `0::/`) capped by `memory.max` and `memory.max - (memory.current - inactive_file)` | same; capped by the root `memory.limit_in_bytes` when below the total | Node's total; `vm_stat` free + inactive + speculative pages. If that fails: Node's free pages (an under-read) | Node's `totalmem`, `freemem` (with standby) |
| cores | Node's, capped by the namespace root's `cpu.max` | Node's (`cpu.cfs_quota_us` not read) | Node's | Node's |
| swap | SwapTotal, SwapFree; total 0 = none | same | none: swap files grow on demand (wider margin; the OS level covers it) | none: Node does not give the page file (wider margin) |
| PSI | `/proc/pressure/memory`; missing = none (margin only) | same | none: the OS level `kern.memorystatus_vm_pressure_level` (1 ok, 2 elevated, 4 severe; else unreadable) | none, no OS level: available against the margin only |
| total, available | `/proc/meminfo` MemTotal, MemAvailable (kB); in a container capped by the root's `memory.max` and `memory.max - (memory.current - inactive_file)` | same; capped by the root `memory.limit_in_bytes` when below the total | Node's total; `vm_stat` free + inactive + speculative pages. If that fails: Node's free pages (an under-read) | Node's `totalmem`, `freemem` (with standby) |
| cores | Node's, capped by the root's `cpu.max` | Node's (`cpu.cfs_quota_us` not read) | Node's | Node's |
| swap | SwapTotal, SwapFree; total 0 = none | same | none: swap files grow on demand (wider margin; the OS level covers it) | none: Node does not give the page file (wider margin) |
| PSI | `/proc/pressure/memory`; missing = none (margin only) | same | none: the OS level `kern.memorystatus_vm_pressure_level` (1 ok, 2 elevated, 4 severe; else unreadable) | none, no OS level: available against the margin only |
"//": "Fixtures for the capacity readings (capacityReadings.ts; the kit's Python reader later runs the same cases). A host: platform, Node's numbers, files (text, or {error: unreadable}; a path not listed is missing) and commands ('file arg ...' -> stdout; not listed = failed). A case: a host, `failed` when it is a failed or half reading (it must never give more room than the healthy host), an optional patch (files/commands merged key by key, null removes; other keys replace), what to read, and the expected keys (only those given are compared; gaps are compared by reading name). Expected values are worked by hand: 1 MB = 1048576 bytes = 1024 kB, rounded down.",
"//": "Fixtures for the capacity readings (capacityReadings.ts; the kit's Python reader later runs the same cases). A host: platform, Node's numbers, files (text, {error: unreadable} or {error: unsupported} (EOPNOTSUPP: the kernel has the file but the feature is off); a path not listed is missing) and commands ('file arg ...' -> stdout; not listed = failed). A case: a host, `failed` when it is a failed or half reading (it must never give more room than the healthy host), an optional patch (files/commands merged key by key, null removes; other keys replace), what to read, and the expected keys (only those given are compared; gaps are compared by reading name). Expected values are worked by hand: 1 MB = 1048576 bytes = 1024 kB, rounded down.",
"hosts": {
"linux-v2": {
"platform": "linux",
Expand DownExpand Up
@@ -252,6 +252,14 @@
"read": "machine",
"expect": { "psi": "unreadable", "gaps": [] }
},
{
"name": "PSI built in but turned off",
"why": "psi=0 at boot or CONFIG_PSI_DEFAULT_DISABLED (the RHEL 8 family): the file exists but reading it fails with EOPNOTSUPP. The kernel says it has no such signal: none, and the gap says so (not unreadable, which would hold the level at elevated for ever)",
"why": "systemd-nspawn, LXC/Incus or podman --systemd: this process sits in a unit (0::/init.scope), not at the namespace root. The root's memory.max and cpu.max still exist, so the cap is the container's: 4096 / 3328 / 2 as in 'container with a memory and CPU limit'",
"why": "/proc/self/cgroup is not needed to find the cap: the root's memory.max and cpu.max decide. A failed read of it never removes the cap: 4096 / 3328 / 2",
"why": "a real host's cgroup v2 root has no memory.max or cpu.max; this process's unit has its own limits (1 GB, 1 core). Those are the unit's, not the machine's: 12122 / 6886 / 12",
"why": "the 2 GB container of 'cgroup v1 container with a limit', but memory.stat (how v1 is found) cannot be read: cgroup unreadable, available and cores unreadable (never the host's 4096 / 4)",
it("reads this machine when it is Linux", async () => {
const host = nodeCapacityHost("linux");
if (!("text" in (await host.readFile("/proc/meminfo")))) return;
Expand Down
Loading
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Loading
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.