Return to BSD News archive
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!news.eng.convex.com!newshost.convex.com!bcm.tmc.edu!cs.utexas.edu!news.tamu.edu!bloom-beacon.mit.edu!news.mathworks.com!hunter.premier.net!insync!uunet!inXS.uu.net!in2.uu.net!panix!not-for-mail From: tls@panix.com (Thor Lancelot Simon) Newsgroups: comp.os.linux.networking,comp.unix.bsd.netbsd.misc,comp.unix.bsd.freebsd.misc Subject: TCP latency Supersedes: <4schf6$sbl@panix2.panix.com> Date: 15 Jul 1996 00:35:29 -0400 Organization: Panix Lines: 34 Message-ID: <4schqh$ssa@panix2.panix.com> References: <4paedl$4bm@engnews2.eng.sun.com> <m24tnf9f69.fsf@frob.mlm.extern.lrz-muenchen.de> <4sbhrq$msh@enomem.lkg.dec.com> <31E995B6.573A3461@lambert.org> NNTP-Posting-Host: panix2.panix.com Xref: euryale.cc.adfa.oz.au comp.os.linux.networking:45222 comp.unix.bsd.netbsd.misc:4046 comp.unix.bsd.freebsd.misc:23581 In article <31E995B6.573A3461@lambert.org>, Terry Lambert <terry@lambert.org> wrote: >Matt Thomas wrote: >] In article <m24tnf9f69.fsf@frob.mlm.extern.lrz-muenchen.de>, >] Andi Kleen <andi@mlm.extern.lrz-muenchen.de> writes: >] >] >I think a mmap() interface to sockets would be more elegant (and >] >you could do exactly the same thing) >] >] I can't see how mmap() would map to a socket. Unlike a file, >] you can't directly address portions of a communication stream. >] What would lseek do? Sockets have semantics that are very >] sequential in nature. mmap is not a good fit. >] >] How would you use mmap on a pipe? > >You would map the buffer into both the source and target >applications address spaces, and avoid the user->kernel->user >copies. If you want to do that, don't you want to just change copyin/copyout to copy any unaligned portion at either end, and then map instead of copying the middle? This wins for everything, without requiring a change in user-level semantics. I was lucky enough to get to discuss this with Kirk McKusick at one point a few months ago. He indicated that at least one version of Mach had done exactly that on the VAX, and that it turned out to be a win iff you wanted to move more than about 8K. Of course, that number is so utterly hardware dependent... -- Thor Lancelot Simon tls@panix.COM "Gee, if your knee jerks any harder you're going to kick yourself in the head." -- Barry Sherman