From owner-freebsd-acpi@FreeBSD.ORG Tue Oct 26 22:59:47 2010 Return-Path: Delivered-To: acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 377B0106566B; Tue, 26 Oct 2010 22:59:47 +0000 (UTC) (envelope-from nate@root.org) Received: from mail.root.org (root.org [208.72.84.34]) by mx1.freebsd.org (Postfix) with ESMTP id 0E1AF8FC17; Tue, 26 Oct 2010 22:59:46 +0000 (UTC) Received: from [10.1.0.199] (dsl081-053-082.sfo1.dsl.speakeasy.net [64.81.53.82]) by mail.root.org (Postfix) with ESMTP id C67AD6A6E; Tue, 26 Oct 2010 22:44:35 +0000 (UTC) Message-ID: <4CC759D5.2020207@root.org> Date: Tue, 26 Oct 2010 15:44:37 -0700 From: Nate Lawson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.11) Gecko/20101013 Thunderbird/3.1.5 MIME-Version: 1.0 To: Alexander Motin References: <201010261904.o9QJ4iwq089834@sana.init-main.com> <4CC732C7.50409@FreeBSD.org> In-Reply-To: <4CC732C7.50409@FreeBSD.org> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: acpi@freebsd.org, current@freebsd.org Subject: Re: Event based scheduling and USB. X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Oct 2010 22:59:47 -0000 On 10/26/2010 12:57 PM, Alexander Motin wrote: > Takanori Watanabe wrote: >> I updated my FreeBSD tree on laptop, to the current >> as of 18 Oct.2010, it works fine with CPU C3 state enabled, >> >> I think this is your achievement of event time scheduler, >> thanks! Ah, so mav@ implemented a tickless-scheduler? That is nice. >> But when USB driver is enabled, the load average is considerablly >> high (0.6 to 1.0) if sysctl oid kern.eventtimer.periodic is set to 0. >> Then kern.eventtimer.periodic is set to 1, the load average goes >> to 0 quickly as before, but almost never transit to C3. >> >> Is this behavior expected, or something wrong? The USB controller often keeps the bus mastering bit set. This keeps the system out of C3. The way to fix this is to implement global suspend. Put a device in suspend mode and then turn off power to the USB port it is on. Then the USB controller will stop polling the bus. >> I noticed one of usb host controller device shares HPET irq. >> When I implement interrupt filter in uhci driver, the load average >> goes to 0 as before. >> >> >> ==== >> % vmstat -i >> interrupt total rate >> irq1: atkbd0 398 2 >> irq9: acpi0 408 2 >> irq12: psm0 3 0 >> irq19: ehci1 37 0 >> irq20: hpet0 uhci0 35970 230 >> irq22: ehci0 2 0 >> irq256: em0 4 0 >> irq257: ahci0 1692 10 >> Total 38514 246 >> === > > I haven't noticed that issue and it is surely not expected for me. I > will try to reproduce it. > > Most likely you should be able to avoid interrupt sharing using some > additional HPET options, described at hpet(4). This seems silly. The whole point of APIC is to avoid clustering on a single interrupt but the BIOS put the timer on the USB controller irq? >> It's time to implement powertop for freebsd, isn't it? > > Surely it is. I was even thinking about possibility to port one from > OpenSolaris, but other work distracted me. You may take it, it you wish. It seems worth doing the internals new, but maybe outputting information in a compatible format for reporting tools. -- Nate