diff options
author | jkim <jkim@FreeBSD.org> | 2011-04-05 18:40:19 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2011-04-05 18:40:19 +0000 |
commit | 48e4efea84a5a2658b09e918afca1f07c10e41f1 (patch) | |
tree | 49b6fb33f7040c5d37b47f9088e95cd712c00f47 /sys/dev/acpica | |
parent | 32bac9120d112ae87b4aa7563f2094fdca3a1c9a (diff) | |
download | FreeBSD-src-48e4efea84a5a2658b09e918afca1f07c10e41f1.zip FreeBSD-src-48e4efea84a5a2658b09e918afca1f07c10e41f1.tar.gz |
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.
Diffstat (limited to 'sys/dev/acpica')
-rw-r--r-- | sys/dev/acpica/acpi_timer.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/sys/dev/acpica/acpi_timer.c b/sys/dev/acpica/acpi_timer.c index 5be8fbc..67f47d9 100644 --- a/sys/dev/acpica/acpi_timer.c +++ b/sys/dev/acpica/acpi_timer.c @@ -306,12 +306,12 @@ SYSCTL_PROC(_machdep, OID_AUTO, acpi_timer_freq, CTLTYPE_INT | CTLFLAG_RW, 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; |