Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Feb 2001 11:21:02 -0800
From:      Alfred Perlstein <bright@wintelcom.net>
To:        David Greenman <dg@root.com>
Cc:        bsddiy <bsddiy@163.net>, freebsd-net@FreeBSD.ORG
Subject:   Re: sendfile()
Message-ID:  <20010201112102.O26076@fw.wintelcom.net>
In-Reply-To: <200102011819.KAA23975@implode.root.com>; from dg@root.com on Thu, Feb 01, 2001 at 10:19:28AM -0800
References:  <1217774688.20010201133139@163.net> <200102011819.KAA23975@implode.root.com>

next in thread | previous in thread | raw e-mail | index | archive | help
* David Greenman <dg@root.com> [010201 11:07] wrote:
> >I don't want to bring flame war, but the following Linus' words may be
> >right:

Really David (Xu), what part do you believe to be correct?

>    The FreeBSD API is the way it is after a collaboration with the Apache
> folks. The sendfile() implementation in FreeBSD works just fine and I think
> it has one of the most complete API's of any of them out there. Sounds like
> typical Linus misinformation.
>    If you have a point to make, then make it. I would be happy to consider
> any real shortcomings in sendfile(), but right now I don't know about any.

David Greenman is right, I don't see how using the TCP_CORK option
(more on that later) which basically turns the one-syscall sendfile
method into a mess of:

  setsocktopt/ioctl +TCP_CORK
  writev (most likely required)
  linux-sendfile
  writev (possibly optional)
  setsocktopt/ioctl -TCP_CORK (or possibly close)

Now to give Linux the benifit of the doubt (because everyone has
to i guess), if TCP_CORK is inherited from the accept() socket,
then you loose one syscall.  If TCP_CORK is cleared and socket
flushed in a timely manner at close() you ditch another syscall,
but it's still at least one additional syscall and pretty obtuse
API.

Oh, and about TCP_CORK, it's a kewl name, and I commend the Linux
camp on thier kewl named additions to the system, but to be honest
they aren't really as brilliant (or goodlooking) as they think.
TCP_CORK should have been made into a socket level option, not a
protocol level option.

For some reason I'm shocked Linus would have ranted like this on
a public list, my guess is that this is a pretty old message dug
up from the archives to stir a bit of flamage on the lists.

When I first read it I was wondering what David Xu's point was,
and I'm still wondering.

> >-----
> >The fact I dislike about the HP-UX implementation is that it is so obviously stupid.
> >
> >And I have to say that I absolutely despise the BSD people. They did sendfile()
> >after both Linux and HP-UX had done it, and they must have known about both
> >implementations. And they chose the HP-UX braindamage, and even brag about
> > the fact that they were stupid and didn't understand TCP_CORK (they don't
> > say so in those exact words, of course - they just show that they were stupid
> > and clueless by the things they brag about). 
> >
> >Oh, well. Not everybody can be as goodlooking as me. It's a curse.
> >
> >-----
> >
> >Also note how I said that it is the BSD people I despise. Not the HP-UX implementation.
> >The HP-UX one is not pretty, but it works. But I hold open source people to higher standards.
> >They are supposed to be the people who do programming because it's an art-form, not because
> >it's their job.
> >
> >
> >David Xu


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010201112102.O26076>