Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 06 Oct 2006 19:05:40 +0200
From:      Andre Oppermann <andre@freebsd.org>
To:        freebsd-current@freebsd.org
Cc:        freebsd-net@freebsd.org, gallatin@cs.duke.edu, phk@freebsd.org
Subject:   Much improved sendfile(2), sosend_* and soreceive_stream() functions
Message-ID:  <45268CE4.2090601@freebsd.org>

next in thread | raw e-mail | index | archive | help
This is a continuation of the previous postings with similiar titles.

New is a specific soreceive_stream() function for stream protocols (primarily TCP)
that does only one socket buffer lock per socket read instead of one per data mbuf
copied to userland.  When doing netperf tests with WITNESS (full lock tracking and
validation enabled) the receive performance increases from ~360Mbit/s to ~520Mbit/s.
Without WITNESS I could not measure any statistically significant improvement on a
otherwise unloaded machine.  The reason is two-fold: 1) per packet we do a wakeup
and readv() is pretty much as many times as packets come it, thus the general over-
head dominates; 2) the packet input path has a pretty high overhead too.  On heavily
loaded machines which do a lot of high speed receives a performance increase should
be measureable.

This patch rolls the improved sendfile(2), sosend_*() and soreceive_stream()
functions.  In general the send path is improved by between 2.8 and 5.7 times.

The patch is available here:
  http://people.freebsd.org/~andre/sendfile+sosend+soreceive-20061006.diff

Any testing and heavy (code) beating and reviews welcome.

-- 
Andre



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