Date: Tue, 6 Jul 2004 14:22:54 -0700 From: Brooks Davis <brooks@one-eyed-alien.net> To: thefly <thefly@acaro.org> Cc: freebsd-hackers@freebsd.org Subject: Re: ZEROCOPY between kernel and userland Message-ID: <20040706212254.GA22673@Odin.AC.HMC.Edu> In-Reply-To: <20040706133640.GB5922@tyler> References: <FE045D4D9F7AED4CBFF1B3B813C85337051D920B@mail.sandvine.com> <20040706133640.GB5922@tyler>
next in thread | previous in thread | raw e-mail | index | archive | help
--h31gzZEtNLTqOjlF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable [Please don't top-post, it tends to lose context.] On Tue, Jul 06, 2004 at 03:36:40PM +0200, thefly wrote: > could you point me pls to some code of that? To me read-only access is > ok, userspace doesn't need to write anything on it, kernelspace does. > But what about locking issues between userspace read access and > kernelspace write access? First, be aware that mmap is not necessicairly faster then copyout on modern CPUs. The cycles required to copy a few K of bytes aren't worth much of anything on a modern CPU compared to a page-fault. Second, if you still want to do things this way, take a look at the geom statistics mechanism. IIRC, it works by using a generation number at the top and bottom of the stats structure. The user copies the entire struct and then verified that the copies of the generation number at the top and bottom of the struct are the same. If so, it uses the copy it got. If not, it tries again. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --h31gzZEtNLTqOjlF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFA6xguXY6L6fI4GtQRAn36AJ9Lc1Fux87d3YcLwDLA5rKTHMudDACgsD/s 8+QhThyeYv8WHd+iS0j/Ncg= =Ipq3 -----END PGP SIGNATURE----- --h31gzZEtNLTqOjlF--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040706212254.GA22673>