[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070926084632.0c82fdba@fujitsu-loaner>
Date: Wed, 26 Sep 2007 08:46:32 -0700
From: Stephen Hemminger <shemminger@...ux-foundation.org>
To: Ingo Molnar <mingo@...e.hu>
Cc: David Schwartz <davids@...master.com>,
"Linux-Kernel@...r. Kernel. Org" <linux-kernel@...r.kernel.org>,
Mike Galbraith <efault@....de>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Martin Michlmayr <tbm@...ius.com>,
Srivatsa Vaddagiri <vatsa@...ux.vnet.ibm.com>
Subject: Re: Network slowdown due to CFS
Here is the combined fixes from iperf-users list.
Begin forwarded message:
Date: Thu, 30 Aug 2007 15:55:22 -0400
From: "Andrew Gallatin" <gallatin@...il.com>
To: iperf-users@...t.nlanr.net
Subject: [PATCH] performance fixes for non-linux
Hi,
I've attached a patch which gives iperf similar performance to netperf
on my FreeBSD, MacOSX and Solaris hosts. It does not seem to
negatively impact Linux. I only started looking at the iperf source
yesterday, so I don't really expect this to be integrated as is, but a
patch is worth a 1000 words :)
Background: On both Solaris and FreeBSD, there are 2 things slowing
iperf down: The gettimeofday timestamp around each socket read/write
is terribly expensive, and the sched_yield() or usleep(0) causes iperf
to take 100% of the time (system time on BSD, split user/system time
on Solaris and MacOSX), which slows things down and confuses the
scheduler.
To address the gettimeofday() issue, I treat TCP different than UDP,
and TCP tests behave as though only a single (huge) packet was sent.
Rather then ending the test based on polling gettimeofday()
timestamps, an interval timer / sigalarm handler is used. I had
to increase the packetLen from an int to a max_size_t.
To address the sched_yield/usleep issue, I put the reporter thread
to sleep on a condition variable. For the TCP tests at least, there
is no reason to have it running during the test and it is best
to just get it out of the way rather than burning CPU in a tight
loop.
I've also incorporated some fixes from the FreeBSD ports collection:
--- include/headers.h
use a 64-bit type for max_size_t
--- compat/Thread.c
oldTID is not declared anywhere. Make this compile
(seems needed for at least FreeBSD & MacOSX)
--- src/Client.cpp
BSDs can return ENOBUFS during a UDP test when the socket
buffer fills. Don't exit when this happens.
I've run the resulting iperf on FreeBSD, Solaris, MacOSX and Linux,
and it seems to work for me. It is nice not to have a 100% CPU
load when running an iperf test across a 100Mb/s network.
Drew
View attachment "non-linux.diff" of type "text/x-patch" (9188 bytes)
Powered by blists - more mailing lists