From owner-freebsd-smp@FreeBSD.ORG Fri Feb 2 00:39:50 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 271BD16A402; Fri, 2 Feb 2007 00:39:50 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 1A4DC13C4C5; Fri, 2 Feb 2007 00:39:50 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 062961A4D90; Thu, 1 Feb 2007 16:39:50 -0800 (PST) Date: Thu, 1 Feb 2007 16:39:49 -0800 From: Alfred Perlstein To: John Baldwin Message-ID: <20070202003949.GR83651@elvis.mu.org> References: <20070201031801.GQ83651@elvis.mu.org> <20070201033356.GR83651@elvis.mu.org> <200702011607.20679.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200702011607.20679.jhb@freebsd.org> User-Agent: Mutt/1.4.2.2i 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: Fri, 02 Feb 2007 00:39:50 -0000 * John Baldwin [070201 14:54] wrote: > 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. Even if it pessimizes in the general case, it may have specific uses that could be helpful, and would avoid people duplicating work in the future. I hope you plan on committing it soon. > > > * 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 -- - Alfred Perlstein, RED Incorporated Consulting. - coder / sysadmin / FreeBSD Hacker / All that jazz -