From owner-freebsd-performance@FreeBSD.ORG Tue Feb 1 12:18:05 2011 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0F39106564A; Tue, 1 Feb 2011 12:18:05 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id 313A38FC0C; Tue, 1 Feb 2011 12:18:04 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1PkFBL-000HHu-Kg; Tue, 01 Feb 2011 15:18:03 +0300 Date: Tue, 1 Feb 2011 15:18:03 +0300 From: Slawa Olhovchenkov To: Stefan Lambrev Message-ID: <20110201121803.GT18170@zxy.spb.ru> References: <20110128143355.GD18170@zxy.spb.ru> <22E77EED-6455-4164-9115-BBD359EC8CA6@moneybookers.com> <20110128161035.GF18170@zxy.spb.ru> <4D42F87C.7020909@freebsd.org> <20110128172516.GG18170@zxy.spb.ru> <20110129070205.Q7034@besplex.bde.org> <20110201113724.GS18170@zxy.spb.ru> <8979148D-8F2E-49E3-86EE-41CE6F57CDA4@moneybookers.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8979148D-8F2E-49E3-86EE-41CE6F57CDA4@moneybookers.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: freebsd-performance@freebsd.org, Julian Elischer , Bruce Evans Subject: Re: Interrupt performance X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Feb 2011 12:18:05 -0000 On Tue, Feb 01, 2011 at 02:07:51PM +0200, Stefan Lambrev wrote: > > I do some more test and build kernel with KTR. > > Now I don't think that inetrrupt overhead on FreeBSD weight: I try > > polling and don't see any difference. > > > > I see many reported by netperf send errors. I found this > > http://docs.freebsd.org/cgi/mid.cgi?E1Aice9-0002by-00. > > > > After insert into src/nettest_bsd.c usleep(1000) if ENOBUF I see 53% > > idle and ./loop 2000000000 "Elapsed 15188006 us" -- this near to linux > > (Elapsed 14107670 us). > > > > 10% of difference may be by more weight network stack (only 32104 > > ticks from 126136 in interrupt handler and task switching, and 94032 > > -- UDP processing in network stack and passing datagram to driver). > > May be weight SOCKBUF_LOCK/SOCKBUF_UNLOCK and/or > > INP_INFO_RUNLOCK/INP_RUNLOCK. > > Try to run with the same network buffers on FreeBSD and Linux. > I think, the default values in freebsd are much, much lower. Set large buffers on FreeBSD -- the first that I try. Also, netperf use setsockopt() and netperf run on linux with same options (include -s 128K -S 128K). > Also in the past ENOBUF was not handled properly in linux. > > http://wiki.freebsd.org/AvoidingLinuxisms - Do not rely on Linux-specific socket behaviour. In particular, default socket buffer sizes are different (call setsockopt() with SO_SNDBUF and SO_RCVBUF), and while Linux's send() blocks when the socket buffer is full, FreeBSD's will fail and set ENOBUFS in errno. Yes, about ENOBUFS with udp socket I told. And this behaviour (block on udp socket send) in Solaris too. I don't know what behaviour is right.