:extend (using truncate) and then mmap() the destination file, then
:read() directly into the mmap()'d portion.
:
:I'd like to see what numbers you get. :)
:
:-- 
:-Alfred Perlstein - [[EMAIL PROTECTED]|[EMAIL PROTECTED]]
 
    Probably not so good considering the number of faults that will
    be taken.  Also, if the destination filesystem runs out of room
    cp will take a random seg-fault trying to access the map.  Plus
    the dirtying of that many VM pages will seriously effect performance.

    read + write is a better way to do it.  It is still possible to
    double buffer.  In this case simply create a small anonymous shared
    mmap that fits in the L2 cache (like 128K), setup a pipe, fork, and 
    have one process read() from the source while the other write()s to the
    destination.  The added overhead is actually less then 'one buffer copy'
    worth if the added buffering fits in the L1 or L2 cache.

                                        -Matt
                                        Matthew Dillon 
                                        <[EMAIL PROTECTED]>


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to