Repository navigation
Freebsd meminfo - #2790
Merged
Merged
Freebsd meminfo#2790
Conversation
Author
|
Testing before and after this fix on main. |
`compat_meminfo_gb` checks for macOS and Windows; everything else read `/proc/meminfo`, which FreeBSD does not have unless `linprocfs` is mounted. On FreeBSD both numbers came back 0, so every engine fell back to its smallest expert cache, and `tests/test_compat_mem` failed. Compiling on FreeBSD now reads `hw.physmem` for the total and free + inactive pages (`vm.stats.vm.*`) for available, the counterpart of Linux's MemAvailable and of the macOS branch. The laundry queue and ZFS's ARC are left out, as MemAvailable leaves out memory that cannot be reclaimed quickly. `hw_probe` in `telemetry.h` had the same gap and now uses the same function. Linux, macOS and Windows are otherwise unchanged.
`resource_plan.memory_available` and `setup_hw.detect_memory` read `/proc/meminfo`, which FreeBSD does not have unless `linprocfs` is mounted, so on FreeBSD the planner had no memory figure (None) and setup knew neither the total nor what is available. Both now read the kernel's counters with sysctl: `hw.physmem` for the total, and free + inactive pages for available, the definition `compat_meminfo_gb` uses in C. `setup_hw` reuses resource_plan's parser. Other platforms are unchanged.
risner
force-pushed
the
freebsd-meminfo
branch
from
November 13, 2026 16:16
9e275ef to
88386f2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
FreeBSD failed to detect memory, so every engine fell back to its smallest expert cache, and
tests/test_compat_memfailed.Validation
make -C c checkmake -C c cuda-test(if applicable)Compatibility
The non-FreeBSD tests pass
make -C c check, but there are other FreeBSD issues with the full test. However this allowsmake -C c test-cto pass on FreeBSD.