From owner-freebsd-arch@FreeBSD.ORG Sun Jun 20 06:18:03 2010 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FC86106564A; Sun, 20 Jun 2010 06:18:03 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 01D668FC12; Sun, 20 Jun 2010 06:18:02 +0000 (UTC) Received: by fxm7 with SMTP id 7so1710816fxm.13 for ; Sat, 19 Jun 2010 23:18:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=Y7tgw5GNznr1TA0UwVIHCKGMOQ/IQ53XcDxQg8+cOE8=; b=XIxXRDQ7qUAtVWT5fB2qP5Sr7uTbEZP8g/X7dsLu9ME8d11RlMqxAk/Hf/7JMe1bgY 63Ql6j4WnfTeq3ZWOLaEVGpCMl6UNg5sx9Cv7mQwsMprEXH/PqPv0c6mZpcrl0xV/hxF nYWfqx7TkxQaXDRNkY7C7Iv/djV5Bjat0PR80= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=iPLvIVtWBEnMQJRqquUWfChW2FBjQ+Id6nqgC8ZQ725jH695asr/2RTKGSqFSarq8C Qf9+yH83gZHRhkhV5LFzfVSlDwsWMQFPrqk5Sf6IalCEfq5xnDy6WNGqsXSO7yIr09nZ SzWPGwlYRUgSyiyc6VfZ6ZNkaTDaqqd1nBDME= Received: by 10.223.101.4 with SMTP id a4mr3496802fao.71.1277014681668; Sat, 19 Jun 2010 23:18:01 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id r25sm24197971fai.35.2010.06.19.23.17.59 (version=SSLv3 cipher=RC4-MD5); Sat, 19 Jun 2010 23:18:00 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C1DB296.5040605@FreeBSD.org> Date: Sun, 20 Jun 2010 09:17:58 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.24 (X11/20100402) MIME-Version: 1.0 To: Brandon Gooch References: <4C0C1AE4.8050807@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: FreeBSD-Current , freebsd-arch@freebsd.org Subject: Re: RFC: New event timers infrastructure 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: Sun, 20 Jun 2010 06:18:03 -0000 Brandon Gooch wrote: > I've been testing these patches since the first iteration > (et.20100606), and I haven't discovered any related issues. Thank you! > I am unclear about the number of interrupts I should expect from the > hpet0 device (compared to the 99 from the rtc at 100Hz), so here is > the output of vmstat -i with and without the "et" patches: > > With "et" patches: > > interrupt total rate > irq1: atkbd0 369 3 > irq9: acpi0 961 8 > irq12: psm0 1002 9 > irq18: uhci5 140 1 > irq19: uhci2 ehci0* 4823 45 > irq20: hpet0 23893 223 > irq23: uhci3 ehci1 11 0 > irq256: vgapci0 1031 9 > irq257: hdac0 14 0 > irq258: iwn0 4258 39 > irq259: bge0 1 0 > Total 36503 341 > > Without "et" patches: > > interrupt total rate > irq1: atkbd0 449 2 > irq0: clk 17334 99 > irq9: acpi0 1701 9 > irq12: psm0 8784 50 > irq18: uhci5 188 1 > irq19: uhci2 ehci0* 5828 33 > irq23: uhci3 ehci1 11 0 > irq256: vgapci0 1896 10 > irq257: hdac0 14 0 > irq258: iwn0 29571 169 > irq259: bge0 1 0 > Total 65777 378 > > And lastly, the values of the kern.eventtimer sysctls: > > $ sysctl kern.eventtimer > kern.eventtimer.choice: HPET(450) HPET1(440) HPET2(440) HPET3(440) i8254(100) > kern.eventtimer.timer2: HPET1 > kern.eventtimer.timer1: HPET > kern.eventtimer.singlemul: 4 I don't see there neither LAPIC, nor RTC timer. I suppose you have disabled them via device hints. I also suppose you've done it to left with only 100Hz IRQs of i8254 timer. Now, with the patch, these two are still disabled, but system got 4 more HPET timers. As they have higher precedence, two of them were taken (HPET and HPET1). Number if interrupts can be explained by the line: Starting kernel event timers: HPET @ 100Hz, HPET1 @ 128Hz As result, you've got 228Hz IRQs (which then redistributed to every CPU). As your HPET timer doesn't support FSB interrupts, all it's timers share same IRQ vector, seen as "hpet0". If you wish to get back to 100Hz IRQs as before, you may remove your previous clock-disabling hints and add instead: kern.eventtimer.timer1=HPET kern.eventtimer.timer2=NONE kern.eventtimer.singlemul=1 As result, you will have single timer, running at HZ rate. Instead of HPET there you may choose any timer: LAPIC - it is per-CPU, so saves on IPI interrupts, supports one-shot mode and so suitable for further tickless kernel, but it doesn't work in C3 state; HPET{x} - on this hardware it can't be used as per-CPU, it supports one-shot mode, but less suitable for further tickless kernel, as CPUs can't run independently; i8254 - somewhat faster, as it doesn't needs status reading, but due to being also a timecounter it can't be used in one-shot mode; RTC - somewhat slower, has limited set of supported frequencies (powers of 2), only periodic mode. -- Alexander Motin