mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3629] [Engine] fix the host memory probe on hybrid cgroup hosts and on WSL2 without systemd #4724
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4724
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/3629
Author: @chaog992
Created: 10/21/2026
Status: 🔄 Open
Base:
main← Head:host-ram-probe📝 Commits (1)
fafa3c6host memory probe: a hybrid cgroup host, a container on one, and the "0::/" root group (WSL2) are read, not "unknown"📊 Changes
3 files changed (+78 additions, -4 deletions)
View changed files
📝
src/core/expert_source.cpp(+18 -2)📝
sycl/src/core/expert_source.cpp(+18 -2)📝
tests/core/file_expert_source_test.cpp(+42 -0)📄 Description
Problem and result
host_available_memory()returns false, so the engine treats the available RAM as unknown, on a hybrid cgroup host (Ubuntu 20.04-class distributions, WSL2 before 2.5 with systemd) and in a container on one.0::/, a host root group withoutmemory.max(WSL2 without systemd), fails too.With the RAM unknown, the resident RAM mode and
--resident-budget-gibfall back to the file cache, a bare--resident-cpu-expertsexits, and the #633 refusal of an arena larger than the container's limit is skipped without a message. This part is unconfirmed static analysis, from reading the callers.With the fix these layouts read the visible v2 group, the v1 memory group or MemAvailable. A v2 group the mount shows in full, and a container with its own cgroup namespace, read as before.
Related discussion
PR #1856 (AkaP88, closed in the 10-19 reset) fixed the
0::/case alone; this covers it as the first new test. I found no issue or PR about the hybrid layouts.Approach
The probe returned false at the first
0::line whose group is not a directory under the mount. Now:cgroup.controllers(a hybrid host's v1 tmpfs), the0::line adds nothing and the v1 memory group or MemAvailable decides, as the v1 branch already does for a group it cannot see.0::path that the mount shows, as the memory guard'sgroup_dirs(conversation_memory.cpp) does:.and..fail the probe, and a filesystem error counts as "not there".The SYCL copy gets the same change. No new flag.
Validation
Tested:
fafa3c6fon main011c9e60(v0.2.2), WSL 2.3.26 with Ubuntu 24.04.1 (kernel 5.15.167.4, systemd), a hybrid layout.Passed:
file_expert_source_test(CUDA build, sm_120, nvcc 13.0.88; these cases need no GPU), eight new cases: on main it fails at the first (v2 root group); with the fix it passes; with the fix minus the./..check it fails at the last (a path that leaves the mount).host_available_memory()copied verbatim from main and from this branch (src/and the SYCL copy) into a small program:5:memory:/init.scope,0::/init.scope): mainfalse; this branchtrue, 10.46 GiB (MemAvailable).falseon main and a reading with the fix. The container with its own namespace (6 GiB, limit 8 GiB) and the path that leaves the mount (refused) are the same on both. The SYCL copy matchessrc/on every one.stratabuilds and links for CUDA (sm_120), HIP (gfx1201, ROCm clang 22) and SYCL (icpx 2026.1.1).Failed: none observed.
Not run: the engine on a hybrid host or in a container on one: this box has no NVIDIA or AMD card, and my GPU machine is cgroup v2 only. Windows and macOS: the change is inside the Linux branch.
Limits
group_dirs. With no cgroup mount at all, MemAvailable decides.unified/is not read; in systemd's hybrid layout it has no memory controller.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.