Enable use of kernel copies of files in more cases - #20056
Conversation
|
The first two commits are #20055: this was separated out to avoid cherry-picking it. |
|
Can you share any information on how you found this? And maybe some numbers associated, since it's marked |
I just noticed it while working #20055. I recalled the difference between I'll see if I can add a benchmark. |
I can't see a meaningful difference in our existing benchmark of snapshot capture. Will close. Thanks for encouraging rigor here! |
std::io::copywill use syscalls to execute copies in-kernel on a best-effort basis, but the syscalls which provide copies for file ranges are limited, and the wrappingWriteimplementation must be identified as one backed by file handles without intermediate layers.std::fs::copy, on the other hand, can more reliably use syscalls to copy in kernel, including usingfclonefileat/fcopyfileon macOS to effectively create a decoupled hardlink.This change moves to using
tokio::fs::copyfor capturing of files into the filesystem-based store.