Subject: RE: zbufs for NetBSD
To: None <thorpej@wasabisystems.com, kyle.unice@L-3com.com>
From: None <kyle.unice@L-3com.com>
List: tech-kern
Date: 08/23/2002 10:10:00
Jason,
I appreciate the comments, but we are getting a bit de-focused.  For a
network applications programmer using NetBSD, zbufs would (in most cases) be
a benefit.   The benefit is dependant on the type of application and the
amount of data being moved through the networking stack.  For telnet zbufs
would be an inconsequential performance improvment, but for streaming video
on a large packet data link, zbufs could be quite an improvment.  I know
there are ALOT of studies and quantifications that could be done on which
apps would benefit most from zbufs and does NetBSD run those apps, but IMHO
zbufs would be a plus for NetBSD.

Regards,
Kyle

-----Original Message-----
From: Jason R Thorpe [mailto:thorpej@wasabisystems.com]
Sent: Friday, August 23, 2002 9:39 AM
To: kyle.unice@L-3com.com
Cc: david@l8s.co.uk; tech-kern@netbsd.org
Subject: Re: zbufs for NetBSD


On Fri, Aug 23, 2002 at 08:12:34AM -0600, kyle.unice@L-3com.com wrote:

 > The salient point is that copying memory from one buffer to another will
 > always take longer than passing a pointer.  The larger the amount of
memory

That is *not* always true.

In a virtual memory system, "passing a pointer" across a protection boundary
involves changing mappings, which potentially means cache flushing and TLB
invalidation traffic.  The latter can potentially be expensive on a multi-
processor.

For small amounts of data, and even moderate amounts of data, a copy may
in fact be faster than remapping the data.

Now, you talk about VxWorks being ring0 only... THAT would be analogous
to an application running entirely in the NetBSD kernel.  In that case,
NetBSD *already* has the zero-copy semantics I described before (with
the exception of how data is compacted in the socket buffer ... but that
is certainly something that can be tuned, and it only does the compaction
for small amounts of data anyway).

For userland, which VxWorks as you describe it doesn't really have, the
situation is quite different.

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>