Subject: Re: Request for comments: sharing memory between user/kernel space
To: tech-kern@NetBSD.org, Zeljko Vrba <zvrba@globalnet.hr>
From: Bill Stouder-Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 03/22/2007 10:53:23
--ew6BAiZeqk4r7MaW
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Mar 22, 2007 at 02:47:55AM -0500, David Young wrote:
> On Wed, Mar 21, 2007 at 08:02:36AM -0800, Bill Stouder-Studenmund wrote:
> >=20
> > Well, one thing you could do is add an ioctl on a socket that passes in=
=20
> > memory buffers. Then change the socket code so that, on your special=20
> > sockets, data are copied to these pre-allocated buffers rather than a=
=20
> > socket buffer. That will get rid of one copy and would be rather clean.
>=20
> I don't think I understand.  This sounds to me like an asynchronous
> version of readv(2).  I have missed how you save a copy.

Depends on how the socket buffer is being handled. If we have the pending=
=20
info sitting around in mbufs, this change won't do much. You're right that=
=20
it won't save us anything.

If however we copy the incoming packets into the buffer, we save an extra=
=20
copy in the kernel. Yes, we still have a copy to userland, but we have one=
=20
less copy in the kernel.

Take care,

Bill

--ew6BAiZeqk4r7MaW
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (NetBSD)

iD8DBQFGAtCjWz+3JHUci9cRAn6kAJ98FV4rLhW9hV/NwRkPUBfwIdwcRACffzIh
gb3hVe4IeAHqNzRuBNwzbeM=
=ynOc
-----END PGP SIGNATURE-----

--ew6BAiZeqk4r7MaW--