Re: Much improved sendfile(2) kernel implementation

From: Gary Jennejohn <garyj_at_jennejohn.org>
Date: Thu, 21 Sep 2006 14:27:31 +0200
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
Received on Thu Sep 21 2006 - 10:28:07 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:00 UTC