I don't see a copy being necessary, although a simplistic implementation would perform one.
> 2) On SGI's, for server type of operations, the mmap() is the bottleneck.
> You are setting up and tearing down a virtual mapping that you don't
> need
This could be avoided by making mmap "lazy." Mmap would return a pointer to a known unmapped area of address space. The
virtual mapping wouldn't be set up until an actual page fault occurred. Write would recognize the buffer as being one of
these "deferred mmap areas" and do the direct fd -> fd copy rather than setting up the page table entries.
Ultimately though, this still requires an extra system call (mmap + write rather than just copyfd) so it probably still
wouldn't be quite as good as a new "copyfile" system call. An advantage, though, is that some programs will get the benefit
of the optimization without being modified to use a new system call.
By the way, there are applications for this where the input would not be a real file. For example, video capture, or a file
server when doing writes (most file server I/Os are writes).
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu