From owner-cvs-all@FreeBSD.ORG Thu Jan 12 20:21:43 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2293316A41F; Thu, 12 Jan 2006 20:21:43 +0000 (GMT) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 61F2443D48; Thu, 12 Jan 2006 20:21:40 +0000 (GMT) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.13.4/8.13.4) with ESMTP id k0CKLO0X016288 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 12 Jan 2006 15:21:24 -0500 (EST) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.12.9p2/8.12.9/Submit) id k0CKLJNs006849; Thu, 12 Jan 2006 15:21:19 -0500 (EST) (envelope-from gallatin) Date: Thu, 12 Jan 2006 15:21:19 -0500 From: Andrew Gallatin To: Scott Long Message-ID: <20060112152119.A6776@grasshopper.cs.duke.edu> References: <200601110030.k0B0UPOx009098@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200601110030.k0B0UPOx009098@repoman.freebsd.org>; from scottl@FreeBSD.org on Wed, Jan 11, 2006 at 12:30:25AM +0000 X-Operating-System: FreeBSD 4.9-RELEASE-p1 on an i386 Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/em if_em.c if_em.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2006 20:21:43 -0000 Scott Long [scottl@FreeBSD.org] wrote: > scottl 2006-01-11 00:30:25 UTC > > FreeBSD src repository > > Modified files: > sys/dev/em if_em.c if_em.h > Log: > Significant performance improvements for the if_em driver: Very cool. > - If possible, use a fast interupt handler instead of an ithread handler. Use > the interrupt handler to check and squelch the interrupt, then schedule a > taskqueue to do the actual work. This has three benefits: > - Eliminates the 'interrupt aliasing' problem found in many chipsets by > allowing the driver to mask the interrupt in the NIC instead of the > OS masking the interrupt in the APIC. Neat. Just like Windows.. <....> > - Don't hold the driver lock in the RX handler. The handler and all data > associated is effectively serialized already. This eliminates the cost of > dropping and reaquiring the lock for every receieved packet. The result > is much lower contention for the driver lock, resulting in lower CPU usage > and lower latency for interactive workloads. This seems orthogonal to using a fastintr/taskqueue, or am I missing something? Assuming a system where interrupt aliasing is not a problem, how much does using a fastintr/taskqueue change interrupt latency as compared to using an ithread? I would (naively) assume that using an ithread would be faster & cheaper. Or is disabling/enabling interrupts in the apic really expensive? Do you have a feel for how much of the increase was do to the other changes (rx lock, avoiding register reads)? Drew