Have VFS graphdriver use accelerated in-kernel copy#35537
Have VFS graphdriver use accelerated in-kernel copy#35537yongtang merged 4 commits intomoby:masterfrom
Conversation
daemon/graphdriver/vfs/copy_linux.go
Outdated
There was a problem hiding this comment.
Can we just define dirCopy() as a function in both copy_linux and copy_unsupported instead of setting this var?
There was a problem hiding this comment.
This var gets changed in by layer/layer_test.go -- why it changes it, I'm not sure. I would feel comfortable changing it, if I knew why it existed.
There was a problem hiding this comment.
fyi, this is because the chrootarchive archiver performs a re-exec which does some shadow magic and the unit test is not prepared for that.
af1e226 to
65222b7
Compare
daemon/graphdriver/vfs/driver.go
Outdated
There was a problem hiding this comment.
No need for this one, the functions can call copyDir directly.
There was a problem hiding this comment.
Oh nevermind I see the layerstore test is using this... something about nice things...
There was a problem hiding this comment.
Is chrootarchive really necessary now, without it then there would be no need to expose this, especially since Linux no longer needs it...
There was a problem hiding this comment.
What would we do with the non-windows bits? I can do it, but I'd not want to do it in this PR.
|
Looks like experimental got stuck in a syscall: DetailsRestarting it. |
|
Same failure:
|
|
It looks like there's some other problems as well. powerpc and z failed on Details |
|
These errors are likely showing up now because CI runs on VFS. |
65222b7 to
45d7b26
Compare
|
@cpuguy83 It seems like the hardlink was creating the issue. I can break the hardlink fix into its own separate commit if you want, but otherwise, things look good to me. |
|
Separate commit may be good. |
|
There is a test for hard links. |
|
Looks good. |
45d7b26 to
ab90bc2
Compare
|
@cpuguy83 I made the test use |
0c48441 to
a5e7681
Compare
|
I don't see the Windows build being scheduled? |
|
Let me restart, there was an issue earlier with Jenkins |
|
Finally. @cpuguy83 Split the commit. Changed the tests. Should be good to go. |
|
Some benchmarks: |
b40b11a to
5a082b0
Compare
|
It seems like users are no longer able to restart their own Jenkins builds. Is this intentional? |
5a082b0 to
77ab7c2
Compare
|
If it helps, we could merge the non-lolspeed version in, and then I can do another PR with the concurrency stuffs. |
cpuguy83
left a comment
There was a problem hiding this comment.
Right now there's a lot of complexity that seems like we could simplify.
There are currently 3 different concurrency primitives in use.
If we can change this to use at most two concurrency primitives (e.g. chan + a waitgroup to simplify chan handling) that will be a good start.
Not sure what to do with the linked list... it's probably ok but don't often see it in go code. Can we use a slice instead?
|
The linked list seems like a better approach than a slice to me because the slice will require constant resizes / reallocations. I don't see any benefit of using a slice, other than potential perf cost. RE: Concurrency primitives -- I don't see a better way to deal with the inode references. |
|
To me, errgroup would be yet another set of primitives. |
|
There's (multiple) mutex + (multiple) chan + waitgroup. |
|
I mean, I can also break out the concurrency code into a separate module, if that helps? I don't see a particularly good way to actually remove many of these unless we start using interface{} in places, or overloading? |
77ab7c2 to
9b16a95
Compare
Previously, the code would set the mtime on the directories before creating files in the directory itself. This was problematic because it resulted in the mtimes on the directories being incorrectly set. This change makes it so that the mtime is set only _after_ all of the files have been created. Signed-off-by: Sargun Dhillon <sargun@sargun.me>
9b16a95 to
77a2bc3
Compare
|
DockerSwarmSuite.TestSwarmLockUnlockCluster failed. Can someone restart janky? |
- What I did
This change makes the VFS graphdriver use the kernel-accelerated
(copy_file_range) mechanism of copying files, which is able to
leverage reflinks.
The copy package should fulfill all of the capabilities that CopyWithTar
fulfilled as well.
I learned a lot about file system performance on Linux. At least about XFS on machines with reasonably fast I/O, and many cores with lots of memory. The primary barrier here is not disk I/O, as it turns out, but contention inside of the dentry, inode, and allocation group.
- How I did it
I reused the accelerated copy code I had written for the overlay graphdriver.
- How to verify it
I used the existing tests to verify the behaviour.
- Description for the changelog
Use copy_file_range to copy files for VFS on Linux.