logo       

Re: Zero copy transmit: msg#00244

Subject: Re: Zero copy transmit
On Tue, Apr 29, 2003 at 02:33:36PM -0500, Robin Holt wrote:
> On Tue, Apr 29, 2003 at 09:20:41PM +0200, Andi Kleen wrote:
> > A much better way would be to use the POSIX aio interfaces. They support
> > zero copy transmit, but don't require COW. Instead they just tell
> > the user process when it is safe to touch the buffer again.
> > 
> > There was already some code to do aio TCP sending, but it didn't
> > do zero copy and was not merged for some reason.
> > 
> > Also you can already do zero copy transmit using sendfile() 
> 
> Users would need to rewrite all their apps to use either the async or
> sendfile method.  That assumption seems a little broad.

In my experience only a few programs are performance critical in this 
way; and their developers/users usually do not mind changing their programs 
a bit to get the best performance. In fact they are always happy when
they get such knobs from you ;)

>      
> I don't disagree that implementing the remainder of the AIO system
> calls would also be good, but is there something wrong with getting
> write et. al. to work with zero copy?

You have to ask DaveM/Alexey - they had it, but rejected it, apparently
also based on some bad experiences on other operating systems.

I can see their point - e.g. in the worst case each write could
trigger two TLB flush IPIs to all CPUs in the system (one to COW it 
and another to un COW it). You can copy a lot of data in the time
it takes to process all of them, especially on a big machine.

-Andi




<Prev in Thread] Current Thread [Next in Thread>