From owner-freebsd-arch@FreeBSD.ORG Fri Nov 24 00:10:07 2006 Return-Path: X-Original-To: freebsd-arch@FreeBSD.org Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7FC2416A417 for ; Fri, 24 Nov 2006 00:10:07 +0000 (UTC) (envelope-from bde@zeta.org.au) Received: from mailout1.pacific.net.au (mailout1-3.pacific.net.au [61.8.2.210]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0FEF243D4C for ; Fri, 24 Nov 2006 00:09:29 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout1.pacific.net.au (Postfix) with ESMTP id 8BF7864D060; Fri, 24 Nov 2006 11:10:03 +1100 (EST) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id 54DC627417; Fri, 24 Nov 2006 11:10:02 +1100 (EST) Date: Fri, 24 Nov 2006 11:10:00 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Ivan Voras In-Reply-To: Message-ID: <20061124104830.B39451@delplex.bde.org> References: <20061119041421.I16763@delplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-arch@FreeBSD.org Subject: Re: What is the PREEMPTION option good for? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Nov 2006 00:10:07 -0000 On Thu, 23 Nov 2006, Ivan Voras wrote: > Ivan Voras wrote: >> Bruce Evans wrote: >> >>> Most of the difference is caused by pgzero becoming too active with >>> PREEMPTION. >> >> Don't know about the other things but I've noticed pagezero is >> suspiciously active on heavy loaded SMP web servers (even complained on >> @stable a long time ago). I'll try disabling PREEMPTION and see how it goes. > > Ok, I couldn't run extensive tests because people were waiting to use > the machine, so this should be considered anecdotal evidence. On a > simple benchmark that repeatedly (for 1 minute) and concurrently > (target=50 concurrent requests) hits a dynamic web page on a development > machine (2 proc true SMP), the performance goes up from ~85 > requests/sec. to ~105 requests/s by disabling PREEMPTION. This > improvement looks suspiciously high to me, but I don't think I'll be > going back :) pagezero is now not noticable in 'top' output. I (or someone) will make pgzero not depend on PREEMPTION. I found what PREEMPTION is good for -- it is to not completely lose to RELENG_4 for interrupt latency. Without PREEMPTION, hitting caps lock results in the keyboard interrupt handler busy-waiting for 3-5 msec while programming the LED. The keyboard driver has always done this stupidly, but it doesn't matter much if interrupt priorities work right. Without PREEMPTION, interrupt priorities don't work right -- higher priority interrupt handlers don't run while the very low priority keyboard interrupt handler is running. This results in several thousand packets per second being dropped in my network blast tests. I'm testing bge mainly on a !SMP system with an rx load of 240kpps. My bge has an rx ring size of 1024, so drops shouldn't occur unless the latency is > 4mS, but it is apparently much higher than 3-5mS since I lose 1-3k packets when I hit caps lock. PREEMPTION is less needed for SMP systems since it takes something like 2 kernel threads busy-waiting for too long at the same time to give very large interrupt latencies. Bruce