Repository navigation
Conversation
A files mount links each file into its directory with one Copier, one CopyFile per file, each from its own snapshot's overlay. Before it links a file, selectBase finds the lowest layer still visible below the file's directory, asking every layer about every ancestor directory: an lstat and up to two getxattr calls each. The files' snapshots share most of their layers, the image the container they came from was built on, so a link step's ~1,400 archives asked the same layers the same questions again for each file. A lowerdir can't change while an overlay uses it, so keep each lowerdir path's answer for the whole copy, shared by its sources. An upperdir's answers are still asked each time. Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
…wers The shared-lowerdir test checked each source still links from its own visible layer, which held without the shared answers too. Check that a second source on the same lowerdir asks only about its own layers, and that an upperdir's answers are never kept. Signed-off-by: Erik Sipsma <[email protected]>
The test checked which answers the copy kept, which still held if the copy stopped reading them back. Count the paths a second source asks the filesystem about: its own layers, never the lowerdir the first source already asked about. Signed-off-by: Erik Sipsma <[email protected]>
Contributor
Author
|
Folded unchanged into #15007, the engine performance batch; continuing there. |
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.
A files mount links each file into its directory with one
Copier, oneCopyFileper file, each from its own snapshot's overlay. Before linking a file, the copy finds the lowest layer still visible below it by asking every layer about every ancestor directory: an lstat and up to two getxattr calls each. The files' snapshots usually share most of their layers, so a mount of ~1,400 files asked the same lowerdirs the same questions again for every file.A lowerdir can't change while an overlay uses it, so one copy now keeps each lowerdir path's answer and shares it across its sources. Upperdirs aren't added to this shared cache. Each source still picks the same layer as before, and errors are unchanged.
Measured: the copy stays linear in the number of files, at about 30% less time per file (copying from N 6-layer overlays sharing 5 layers: 109–138 µs per file before, 70–99 µs after, for N from 100 to 2,800). In a Go link step with ~1,400 mounted package archives, building the exec's spec went from 104 ms to 78.5 ms. That was too small to show in the builds' overall wall time.
The tests check that each source still links its file from its own visible layer when sources stack shared lowerdirs differently, and that a second source asks the filesystem only about its own layers.