DragonFly kernel List (threaded) for 2003-07
Re: just curious
Matthew Dillon wrote:
Yes. Compare it against the Mach 'I'm going to map the data into your
address space' model. There will be some cases where having the kernel
map the address space is more efficient (saving two system calls),
but most of the time there is no need or reason to map the data and in
those cases passing a descriptor is far more efficient.
Indeed. Most of the layering cases that Terry Lambert was presenting as
potential problems can be avoided by passing these kinds of handles
around. Plus, they could easily be exposed over the network via NFS or
sockets to non-dragonfly operating systems and applications. For a
webserver that would allow for a heck of an optimization: just open a
file readonly and then attach the client's socket to it... with smart
enough hardware you could practically DMA straight from the SCSI card to
the ethernet card. Or you could move most of NFS to user mode and still
get kernel NFS performance...
copyfile(int sfd, int dfd, off_t soffset, off_t doffset, off_t bytes)
I assume this operation would end up being implemented by changing the
state of VM buffers, yes?