Raise host NOFILE capacity for the guest FD table#204
Open
Xalestar wants to merge 2 commits into
Open
Conversation
elfuse exposes a 1024-entry guest FD table but currently inherits the host RLIMIT_NOFILE unchanged. With a host soft limit of 256, guests hit host-side EMFILE after opening 248 additional descriptors and test-stress fails deterministically. Ensure the top-level elfuse process has capacity for FD_TABLE_SIZE plus 64 descriptors reserved for runtime-owned pipes, fork IPC, debugger sockets, and sysroot/FUSE plumbing. Preserve the host hard limit and report a startup error when the required capacity cannot be established. Fork helpers inherit the capacity established by the top-level process and do not reapply the startup policy after a guest may have changed RLIMIT_NOFILE.
Collaborator
Keep the host descriptor reserve internal by serving guest NOFILE queries and updates from a guest-side 1024/1024 limit. Guest setrlimit no longer lowers the host capacity that elfuse needs for runtime and fork IPC. Carry the guest limit through the fork protocol, restore inherited descriptors before applying a lowered soft limit, and recheck host capacity in fork helpers. Add regressions for hidden reserve reporting and fork after lowering the hard limit. PR sysprog21#148 addresses the same low-host-limit failure with a different startup policy and a host-side regression wrapper. Close sysprog21#68
32b48db to
e189210
Compare
Author
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.
Problem
elfuse exposes a guest FD table with 1024 entries, but the host process may start with a much smaller soft RLIMIT_NOFILE. On a host soft limit of 256, the stress test can open only about 248 guest descriptors before the host runs out of descriptors, even though the guest table still has capacity.
Host capacity and guest-visible NOFILE state also need to remain separate: exposing the internal reserve reports an unreachable limit, while forwarding guest setrlimit to the host can remove capacity needed by fork IPC.
Change
Verification
Questions for maintainers
Related work
PR #148 addresses the same issue by raising the host limit in fdtable initialization and adding a host-side low-limit regression wrapper. This PR also separates guest-visible NOFILE state from elfuse internal host capacity and preserves that state across fork IPC.
Close #68