From owner-freebsd-smp@FreeBSD.ORG Thu Feb 1 23:23:22 2007 Return-Path: X-Original-To: smp@freebsd.org Delivered-To: freebsd-smp@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B19D616A408 for ; Thu, 1 Feb 2007 23:23:22 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.freebsd.org (Postfix) with ESMTP id 4666113C4AA for ; Thu, 1 Feb 2007 23:23:22 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id l11MsNRI094270; Thu, 1 Feb 2007 17:54:23 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Alfred Perlstein Date: Thu, 1 Feb 2007 16:07:20 -0500 User-Agent: KMail/1.9.1 References: <20070201031801.GQ83651@elvis.mu.org> <20070201033356.GR83651@elvis.mu.org> In-Reply-To: <20070201033356.GR83651@elvis.mu.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200702011607.20679.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Thu, 01 Feb 2007 17:54:23 -0500 (EST) X-Virus-Scanned: ClamAV 0.88.3/2513/Thu Feb 1 11:48:53 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: smp@freebsd.org Subject: Re: mapping interrupts to a particular cpu X-BeenThere: freebsd-smp@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD SMP implementation group List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Feb 2007 23:23:22 -0000 On Wednesday 31 January 2007 22:33, Alfred Perlstein wrote: > Through source inspection it appears that we don't have interrupts > running in the context of the actual interrupt handler unless they > are truly "FAST". (correct me if I'm wrong). > > That makes my decision a lot easier. I will just use bind_cpu. > > If so, I will just use bind_cpu. What is bind_cpu, sched_bind maybe? If you want to bind interrupts to CPUs, look at http://www.FreeBSD.org/~jhb/patches/intr_bind.patch It's tested and works on i386 and amd64 and lets you bind interrupts to specific CPUs. There is a sysarch() to do it, so you can write a trivial userland app. It doesn't currently provide a way for userland to ask which interrupts are bound to which CPUs. I'm mostly waiting for folks to benchmark it to make sure it isn't a pessimization. > * Alfred Perlstein [070131 19:18] wrote: > > [[jhb cc'd cause he's Mr Apic from what I understand.]] > > > > I'm trying to figure out pinning interrupts to a particular cpu. > > > > If it can be done, if it's worth it and how. > > > > Any generic pointers one could give to help me do this? I'd like to > > bind network interfaces to a particular cpu. > > > > I guess the questions boil down to: > > > > 1) Are we at the point that an interrupt for something such as an > > ethernet device actually runs under interrupt context? > > (or do we always switch to an ithread (for !FAST_INTR)) > > (I already know about bind_cpu which can be done inside interrupt > > routine (I think?)) > > > > Anyhow, if we have the actual interrupts running directly... > > 2) How can I bind an interrupt source to a cpu? > > 3) Is there a way to determine which cpu is best to wire an interrupt to? > > > -- John Baldwin