From owner-freebsd-hackers Sun Mar 8 12:19:09 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA05895 for freebsd-hackers-outgoing; Sun, 8 Mar 1998 12:19:09 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from friley585.res.iastate.edu (friley585.res.iastate.edu [129.186.167.85]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA05538 for ; Sun, 8 Mar 1998 12:17:58 -0800 (PST) (envelope-from ccsanady@friley585.res.iastate.edu) Received: from friley585.res.iastate.edu (loopback [127.0.0.1]) by friley585.res.iastate.edu (8.8.8/8.8.8) with ESMTP id OAA03298; Sun, 8 Mar 1998 14:17:49 -0600 (CST) (envelope-from ccsanady@friley585.res.iastate.edu) Message-Id: <199803082017.OAA03298@friley585.res.iastate.edu> X-Mailer: exmh version 2.0.1 12/23/97 cc: Marc Slemko , Julian Elischer , hackers@FreeBSD.ORG Subject: Re: kernel wishlist for web server performance In-reply-to: Your message of "Sun, 08 Mar 1998 13:54:22 CST." <199803081954.NAA03166@friley585.res.iastate.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 08 Mar 1998 14:17:49 -0600 From: Chris Csanady Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > >>On Sat, 7 Mar 1998, Julian Elischer wrote: >> >>> > >>> > Let me put it this way: how else do you propose to do copy avoidance to >>> > avoid an extra copy going into the mbufs? The data must go from the >>> > buffer cache to the network without any copy other than to the network >>> > card itself. Why is your other method of doing this any less of a hack? >>> [...] >>> I would like to add here that in FreeBSD's unified VM/Buffer cache, >>> a mmapped file IS the buffer cache >>> so that a send() from an mmapped file IS copying direct fromt he buffer >>> cache. Ther eis ONE copy.. that from the buffer cache, into the mbuf. >> >>But the point is that you still have to copy it into the mbuf, you still >>have to use the memory for the mbuf, etc. This uses more CPU and memory >>bandwidth, increases memory use, and means you may have to chop things up >>smaller to avoid using too much memory for mbufs. > >And unless you introduce a special hack for each case that comes up, Ugh.. Major slip of the mouse here, let me finish this up. I don't believe that this can be done with no extra copies without the sendfile(). Network cards impose way too many restrictions on memory, and alignment for this to be possible otherwise. Unless the buffer cache knows in advance which net interface the buffer is leaving through, this would not be possible. But then, you would make this data useless for much else. I do not see a generic way to accomplish this short of tangling all sorts of things, and using hacks such as a sendfile(). :( Not that I think this should be done or not.. I'll leave that to someone else. :) Chris To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message