From owner-freebsd-net@FreeBSD.ORG Mon Mar 5 21:27:21 2007 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2392216A402; Mon, 5 Mar 2007 21:27:21 +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 9850B13C428; Mon, 5 Mar 2007 21:27:20 +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.8/8.13.8) with ESMTP id l25LREHq004906; Mon, 5 Mar 2007 16:27:17 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Andrew Gallatin Date: Mon, 5 Mar 2007 16:27:36 -0500 User-Agent: KMail/1.9.1 References: <45E8276D.60105@freebsd.org> <200703051352.29939.jhb@freebsd.org> <17900.33030.751272.890853@grasshopper.cs.duke.edu> In-Reply-To: <17900.33030.751272.890853@grasshopper.cs.duke.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200703051627.37320.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]); Mon, 05 Mar 2007 16:27:17 -0500 (EST) X-Virus-Scanned: ClamAV 0.88.3/2736/Mon Mar 5 13:55:43 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: Andre Oppermann , freebsd-current@freebsd.org, Robert Watson , kmacy@freebsd.org, freebsd-net@freebsd.org Subject: Re: New optimized soreceive_stream() for TCP sockets, proof of concept 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: Mon, 05 Mar 2007 21:27:21 -0000 On Monday 05 March 2007 15:43, Andrew Gallatin wrote: > > John Baldwin writes: > > > John has a patch that pins interrupt threads, etc, not sure what the status > > of > > > that is. CC'd. > > > > Tested and around for over a year. Sent to people several times but no > > benchmarking has resulted. It lives in p4 in //depot/user/jhb/intr/... > > > > I've just regenerated the patch at > > http://www.FreeBSD.org/~jhb/patches/intr_bind.patch (same URL as the last N > > It seems very useful, in conjunction with some sort of CPU binding > API. With ULE, and netserver bound via a hack to CPU 1, I > can nearly double the bandwidth by binding my ithread > to the opposite CPU using your patch. > > BTW, you need a little sanity checking somehere in the API > I tried to remove binding, and guessed at binding to -1 rather > than reading the source. That resulted in this panic: > > # ./ibind/ibind 256 -1 > kernel trap 12 with interrupts disabled > > > Fatal trap 12: page fault while in kernel mode > cpuid = 1; apic id = 01 > fault virtual address = 0x3806778bc > fault code = supervisor read data, page not present > instruction pointer = 0x8:0xffffffff8040a509 > stack pointer = 0x10:0xffffffff91e88ad0 > frame pointer = 0x10:0xffffffff91e88b00 > code segment = base 0x0, limit 0xfffff, type 0x1b > = DPL 0, pres 1, long 1, def32 0, gran 1 > processor eflags = resume, IOPL = 0 > current process = 788 (ibind) > [thread pid 788 tid 100047 ] > Stopped at intr_bind+0xe9: movl cpu_apic_ids(,%rdi,4),%esi > db> bt > Tracing pid 788 tid 100047 td 0xffffff001ea1b840 > intr_bind() at intr_bind+0xe9 > sysarch() at sysarch+0x14a > ia32_syscall() at ia32_syscall+0x236 > Xint0x80_syscall() at Xint0x80_syscall+0x60 > > Thanks again! There's currently no way to remove binding, and yes, the interface is a bit rough. We need a way for userland to query the current state for example. And I really think we might need to provide an MI interface with an MD callback. -- John Baldwin