From owner-freebsd-net@FreeBSD.ORG Fri Oct 14 23:46:39 2005 Return-Path: X-Original-To: net@freebsd.org Delivered-To: freebsd-net@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8678616A41F for ; Fri, 14 Oct 2005 23:46:39 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DBE8E43D45 for ; Fri, 14 Oct 2005 23:46:38 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.0.87]) by mailout2.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id j9ENkNv7025410; Sat, 15 Oct 2005 09:46:23 +1000 Received: from epsplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailproxy2.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id j9ENkK5j002183; Sat, 15 Oct 2005 09:46:21 +1000 Date: Sat, 15 Oct 2005 09:46:22 +1000 (EST) From: Bruce Evans X-X-Sender: bde@epsplex.bde.org To: Andrew Gallatin In-Reply-To: <17231.50841.442047.622878@grasshopper.cs.duke.edu> Message-ID: <20051015092141.F1403@epsplex.bde.org> References: <17231.43525.446450.161986@grasshopper.cs.duke.edu> <13600.1129298731@critter.freebsd.dk> <17231.50841.442047.622878@grasshopper.cs.duke.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Garrett Wollman , Poul-Henning Kamp , net@freebsd.org Subject: Re: Call for performance evaluation: net.isr.direct (fwd) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2005 23:46:39 -0000 On Fri, 14 Oct 2005, Andrew Gallatin wrote: > Bear in mind that I have no clue about timekeeping. I got into this > just because I noticed using a TSC timecounter reduces context switch > latency by 40% or more on all the SMP platforms I have access to: > > 1.0GHz dual PIII : 50% reduction vs i8254 > 3.06GHz 1 HTT P4 : 55% vs ACPI-safe, 70% vs i8254) > 2.0GHz dual amd64: 43% vs ACPI-fast, 60% vs i8254) > > High context switch latency has been problem since FreeBSD 5 in > networking due to the context switches for netisr use, and for the > context switches required by interrupt threads. I'm sure it is a > problem in other parts of the system. I think it is pretty important, > and I'd really like to see it fixed. I'm not sure about that. More the reverse. Normal interrupts just don't occur often enough for their context switch time to matter. This is most clear for disk devices. Disk devices are relatively slow and have even slower seeks, so have to talk to them in large (~64K) blocks to get reasonable perfermonace and this results in not many transactions (except with especially braindamaged hardware that does something like interrupting for every 512-block). Network devices have a normal packet size of ~1500 bytes so they have to have interrupt moderation to reduce the interrupt load, and non-braindamaged ones do. However, for netisrs I think it is common to process only 1 packet per context switch, at least in the loopback case. Bruce