Skip to content

Linux: memory pressure read from PSI and MemAvailable, off by default - #2156

Merged
ashhart merged 4 commits into
mainfrom
lead/linux-memory-pressure
Nov 14, 2026
Merged

ashhart merged 4 commits into
mainfrom
lead/linux-memory-pressure

Conversation

@ashhart

@ashhart ashhart commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Closes #2129.

core/memory_pressure.zig only read macOS's sysctl. This adds a bounded Linux reading (/proc/pressure/memory and MemAvailable) behind the same levels, sampling and hysteresis. It's off by default, and healthy page cache alone doesn't shed.

Host tests with planted files pass. Not yet run on a device: a GB10 beside a memory hog must shed, recover and not oscillate, with replies equal. That run is ours.

@ashhart
ashhart force-pushed the lead/linux-memory-pressure branch 4 times, most recently from ed48623 to 7800cfb Compare November 8, 2026 03:19
@ashhart
ashhart force-pushed the lead/linux-memory-pressure branch 2 times, most recently from 501be69 to bdc09d3 Compare November 14, 2026 03:24
@ashhart
ashhart marked this pull request as ready for review November 14, 2026 09:13
Exercise reordered real PSI fields and unknown readings without full PSI or MemAvailable through the planted-file reader. Document that the Linux opt-in reads host pressure inside containers and cgroups.
@ashhart
ashhart force-pushed the lead/linux-memory-pressure branch from bdc09d3 to d1ab702 Compare November 14, 2026 14:18
@ashhart
ashhart merged commit 73800bb into main Nov 14, 2026
2 of 10 checks passed
@ashhart
ashhart deleted the lead/linux-memory-pressure branch November 14, 2026 14:19
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.

Memory pressure on Linux: a reading behind the same levels as macOS

1 participant