On Wed, Nov 27, 2024 at 03:14:09PM -0500, Martin K. Petersen wrote: > > Bart, > > > Submitting a copy operation as two bios or two requests means that > > there is a risk that one of the two operations never reaches the block > > driver at the bottom of the storage stack and hence that a deadlock > > occurs. I prefer not to introduce any mechanisms that can cause a > > deadlock. > > How do you copy a block range without offload? You perform a READ to > read the data into memory. And once the READ completes, you do a WRITE > of the data to the new location. > > Token-based copy offload works exactly the same way. You do a POPULATE > TOKEN which is identical to a READ except you get a cookie instead of > the actual data. And then once you have the cookie, you perform a WRITE > USING TOKEN to perform the write operation. Semantically, it's exactly > the same as a normal copy except for the lack of data movement. That's > the whole point! I think of copy a little differently. When you do a normal write command, the host provides the controller a vector of sources and lengths. A copy command is like a write command, but the sources are just logical block addresses instead of memory addresses. Whatever solution happens, it would be a real shame if it doesn't allow vectored LBAs. The token based source bio doesn't seem to extend to that.