Add support for larger reads via MaxPages config option#199
Merged
Conversation
vadlakondaswetha
approved these changes
Jun 30, 2026
7ca4480 to
04b7821
Compare
04b7821 to
3173d12
Compare
geertj
approved these changes
Jun 30, 2026
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.
Add MaxPages and MaxWrite configuration to support larger reads/writes and smaller buffers
Description
This PR adds support for configuring
MaxPagesandMaxWriteinMountConfig(Linux only). This enables:MaxPages.MaxWrite(andMaxPagesaccordingly).MaxWrite, which dynamically reduces the size of the pre-allocated FUSE input message buffers.We also introduce sanitization and validation logic to ensure
MaxPagesandMaxWriteare compatible (i.e.,MaxPagesmust be large enough to holdMaxWrite).Key Changes
1. Configuration
mount_config.go: AddedMaxPages uint16andMaxWrite uint32toMountConfigwith detailed documentation on their default behaviors and interactions.2. Connection & Buffer Management
connection.go:inMessageBufSizetoConnectionto track the dynamic buffer size needed for incoming messages (PageSize + MaxWrite).sanitizeMaxPagesAndWrite()to handle default values when one or both ofMaxPagesandMaxWriteare unset, and to validate thatMaxPages * PageSize >= MaxWrite.Connection.Init()to negotiate the configuredMaxPagesandMaxWritewith the kernel.internal/buffer/in_message.go: UpdatedNewInMessage()to accept a dynamic buffer size instead of using a hardcoded constant.freelists.go: UpdatedgetInMessage()to pass the connection's dynamicinMessageBufSizewhen allocating new message buffers.3. API & Documentation Updates
fuseops/ops.go: Updated documentation forReadFileOp.DstandReadFileOp.Data:Dstwill benilwhenMaxPagesis configured for reads larger than the pre-allocated buffer.Data(vectored read) whenDstisnil.4. Tests
connection_test.go: AddedTestSanitizeMaxPagesAndWritecovering various scenarios:MaxWriteconfigured (dynamicMaxPagescalculation).MaxPagesconfigured (dynamicMaxWritecalculation).Testing Done
TestSanitizeMaxPagesAndWriteinconnection_test.go.