Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Sep 2006 14:27:31 +0200
From:      Gary Jennejohn <garyj@jennejohn.org>
To:        alc@FreeBSD.org
Cc:        freebsd-current@FreeBSD.org
Subject:   Re: Much improved sendfile(2) kernel implementation
Message-ID:  <200609211227.k8LCRWFR000879@peedub.jennejohn.org>

next in thread | raw e-mail | index | archive | help
On Wed, Sep 20, 2006 at 11:59:13PM +0200, Andre Oppermann wrote:
> I have rewritten kern_sendfile() to work in two loops, the inner which turns
> as many pages into mbufs as it can up to the free send socket buffer space.
> The outer loop then drops the whole mbuf chain into the send socket buffer,
> calls tcp_output() on it and then waits until 50% of the socket buffer are
> free again to repeat the cycle.  This way tcp_output() gets the full amount
> of data to work with and can issue up to 64K sends for TSO to chop up in the
> network adapter without using any CPU cycles.  Thus it gets very efficient
> especially with the readahead the VM and I/O system do.
> 
> The patch is available here:
>  http://people.freebsd.org/~andre/sendfile-20060920.diff
>

My vesion of gcc (3.4.4) doesn't like the omin() macro. I had to change it
to this:

#define        omin(a, b) ((off_t)a < (off_t)b ? (off_t)a : (off_t)b)

Otherwise I haven't seen any catastrophies yet, but it's only been running
for a few minutes ;-)

-- 
Gary Jennejohn / garyjATjennejohnDOTorg gjATfreebsdDOTorg garyjATdenxDOTde




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