Mount volumes with the runtime's discard and the record's own options - #2175
Closed
MayCXC wants to merge 2 commits into
Closed
Mount volumes with the runtime's discard and the record's own options#2175MayCXC wants to merge 2 commits into
MayCXC wants to merge 2 commits into
Conversation
A volume's ext4 sits on a sparse host file the service created, so the blocks a workload frees belong back on the host as it runs. That is the runtime's concern, owned where the mount is assembled beside the caching and sync modes the runtime already sets there: ext4 volumes mount with continuous discard on every attachment, and a read only mount parses the option as a no-op. volume create --opt also stored driver options the mount path never read back. The local driver's spelling for a volume's own mount options is the o key, a comma separated list the way docker's local driver takes it, and docker never injects defaults into it: everything in o is what the caller named. Resolve o into each attachment's options, split the way the attachment's own option suffix already is, so what a volume was created with rides along everywhere it attaches, and the user's list stays exactly the user's.
/proc/mounts carries the truth: an ext4 volume's line holds discard on a plain-created volume, and a volume created with --opt o=noatime mounts with its record's option beside the runtime's discard.
7 tasks
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.
Type of Change
Motivation and Context
Closes #2168.
A volume's ext4 sits on a sparse host file the service created, so the blocks a workload frees belong back on the host as it runs. That is the runtime's concern, owned where the mount is assembled beside the caching and sync modes the runtime already sets there: ext4 volumes mount with continuous discard on every attachment, and a read-only mount parses the option as a no-op.
volume create --optalso stored driver options the mount path never read back. The local driver's spelling for a volume's own mount options is theokey, a comma separated list the way docker's local driver takes it, and docker never injects defaults into it: everything inois what the caller named.oresolves into each attachment's options now, split the way the attachment's own option suffix already is, so what a volume was created with rides along everywhere it attaches, and the user's list stays exactly the user's.Adjacent: #2021 reports the analogous non-release of freed space for virtio-fs bind mounts, which this does not address; #1940 asks for the supported
--volumeoptions to be documented.Testing
New integration coverage reads
/proc/mountsinside the container: an ext4 volume's line holdsdiscardon a plain-created volume, and a volume created with--opt o=noatimemounts with its record's option beside the runtime's discard.Integration suite: 397 passed. Unit suite: 772 passed.
make fmt,make checkclean.