From owner-svn-src-all@FreeBSD.ORG Tue Apr 5 18:40:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCFF4106568D; Tue, 5 Apr 2011 18:40:19 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CAE6C8FC19; Tue, 5 Apr 2011 18:40:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p35IeJ08027038; Tue, 5 Apr 2011 18:40:19 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p35IeJM6027036; Tue, 5 Apr 2011 18:40:19 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201104051840.p35IeJM6027036@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 5 Apr 2011 18:40:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220369 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Apr 2011 18:40:20 -0000 Author: jkim Date: Tue Apr 5 18:40:19 2011 New Revision: 220369 URL: http://svn.freebsd.org/changeset/base/220369 Log: Lower the bar for ACPI-fast on real machines slightly. Empirical evidences show that there are perfectly working PM timers with occasional "hiccups", probably because of an SMI. Now we ignore the maximum if it happens once in the test loop and the width is small enough. Also, relax normal width a bit to count in a boundary case. Modified: head/sys/dev/acpica/acpi_timer.c Modified: head/sys/dev/acpica/acpi_timer.c ============================================================================== --- head/sys/dev/acpica/acpi_timer.c Tue Apr 5 17:41:54 2011 (r220368) +++ head/sys/dev/acpica/acpi_timer.c Tue Apr 5 18:40:19 2011 (r220369) @@ -306,12 +306,12 @@ SYSCTL_PROC(_machdep, OID_AUTO, acpi_tim static int acpi_timer_test() { - uint32_t last, this; - int min, max, n, delta; - register_t s; + uint32_t last, this; + int delta, max, max2, min, n; + register_t s; min = INT32_MAX; - max = 0; + max = max2 = 0; /* Test the timer with interrupts disabled to get accurate results. */ s = intr_disable(); @@ -319,18 +319,21 @@ acpi_timer_test() for (n = 0; n < N; n++) { this = acpi_timer_read(); delta = acpi_TimerDelta(this, last); - if (delta > max) + if (delta > max) { + max2 = max; max = delta; + } else if (delta > max2) + max2 = delta; if (delta < min) min = delta; last = this; } intr_restore(s); - delta = max - min; - if (delta > 2 && vm_guest == VM_GUEST_NO) + delta = max2 - min; + if ((max - min > 8 || delta > 3) && vm_guest == VM_GUEST_NO) n = 0; - else if (min < 0 || max == 0) + else if (min < 0 || max == 0 || max2 == 0) n = 0; else n = 1;