Subject: Re: direct copy() between two proc address spaces
To: Jason Thorpe <thorpej@wasabisystems.com>
From: Eric Haszlakiewicz <erh@jodi.nimenees.com>
List: tech-kern
Date: 06/20/2004 15:58:17
On Sun, Jun 20, 2004 at 10:29:33AM -0700, Jason Thorpe wrote:
> 
> On Jun 20, 2004, at 10:17 AM, Jaromir Dolecek wrote:
> >I believe uiomove() can be used to move data from one process's
> >address space to anothers. I've actually wanted to experiment
> >with this to optimize pipes further.
> 
> No, uiomove() moves between "kernel -> kernel" or "process -> kernel" 
> or "kernel -> process".
> 
> To move data from one process to another, you would need to map the 
> source and target regions into the kernel address space, and then do 
> the copy.  This is possible using the various UVM fault (to ensure that 
> the source and target regions are resident) and mapping functions.

	you also loan the pages from one process to the other, assuming the
data size was "big enough", and the receive buffer was suitably aligned.
(what's big enough?  Didn't someone do some performance tests for this?)

	You'd still need to map and copy for some cases.  A good starting point
to write that function is probably uvm_io() in sys/uvm/uvm_io.c.

eric