From owner-freebsd-performance@FreeBSD.ORG Sat Jan 29 14:17:42 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 AA21C106564A; Sat, 29 Jan 2011 14:17:42 +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 640F78FC0C; Sat, 29 Jan 2011 14:17:41 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1PjBcR-000I1w-4y; Sat, 29 Jan 2011 17:17:39 +0300 Date: Sat, 29 Jan 2011 17:17:39 +0300 From: Slawa Olhovchenkov To: Bruce Evans Message-ID: <20110129141739.GL18170@zxy.spb.ru> References: <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> <20110128215215.GJ18170@zxy.spb.ru> <20110129133859.O967@besplex.bde.org> <20110129102420.GK18170@zxy.spb.ru> <20110129233542.O20731@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110129233542.O20731@besplex.bde.org> 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 , Stefan Lambrev 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: Sat, 29 Jan 2011 14:17:42 -0000 On Sat, Jan 29, 2011 at 11:54:11PM +1100, Bruce Evans wrote: > >> So FreeBSD has about 18% more network overhead (absolute: 65-47), or > >> about 38% more network overhead (relative: (65-47)/47). Not too > >> surprising -- the context switches alone might cost that. > > > > For only 14K vs 56K interrupt. 152% more network overhead per one interrupt. > > No, FreeBSD does 4 times as much work per interrupt. 4 times as much > (300%) "overhead" per interrupt is to be expected, since most (hopefully > more than half :-) of the "overhead" is actual work. > > > And I see drammaticaly less number of context switches in linux stats > > (by dstat). > > FreeBSD uses ithreds for most interrupts, so of course it does many > more context switches (at least 2 per interrupt). This doesn't make > much difference provided there are not too many. I think the version > of re that you are using actually uses "fast" interrupts and a task > queue. This also seems to be making little difference. You get a > relatively lightweight "fast" interrupt following by followed by a > context switch to and from the task. IIRC, your statistics showed > about twice as many context switches as interrupts, so the task queue > isn't doing much to reduce the "interrupt overhead" -- it just gives > context switches to the task instead of to an ithread. It seems as root of difference with linux systems. I found this link http://www.freebsd.org/doc/en/books/arch-handbook/smp-design.html. No light weight context switches in the near future?