On Mon, 19 Aug 2002, Matthew Dillon wrote:

> :Why can't we get rid of VOP_READ(.. UIO_NOCOPY...) call in sendfile()?
> :Me, I can't quite understand what UIO_NOCOPY means... As long as
> :sendfile() function already plays around pages, it can use VOP_GETPAGES().
> :The following patch looks works for me. Could anybody said if it has any
> :benefits or not?

>     UIO_NOCOPY tells the filesystem to not bother copying the data
>     into the passed buffer but to instead simply load it into the buffer
>     cache / VM backing store.
>
>     While this adds buffer cache management overhead, it ought to yield
>     far greater performance over doing a VOP_GETPAGES() at this point
>     because the filesystem will be able to do clustered reads and
>     read-ahead (potentially a 64K I/O) instead of a 4K I/O.
>
>     An alternative would be to cluster the VM pages in sendfile() and
>     call VOP_GETPAGES() on a block of pages instead of just one.  I'm
>     guessing that is not being done because it's about 100 lines of code
>     to do it right.  It's easier just to call vn_rdwr() and let the
>     system do the clustering.

This argument seems to apply to exec_map_first_pages() too.  It does
its own blocking to get up to VM_INITIAL_PAGEIN (normally 16) pages
using only about 50 lines of code, but does this slightly wrong.  It
doesn't honor the device limit of si_iosize_max, unlike filesystem
code.  This used to break exec on zip drives (si_iosize_max used to
be 32K, but VM_INITIAL_PAGEIN pages is 64K bytes on i386's).

Bruce


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

Reply via email to