From 430eaa744eaf0eab45fb3273a053091b5cc231a0 Mon Sep 17 00:00:00 2001 From: Nate Lawson Date: Mon, 30 Jul 2007 15:21:26 +0000 Subject: [PATCH] Dynamically choose the quality of the ACPI timer depending on whether the fast or safe/slow method is in use. Fast remains at 1000, slow is now at 850 (always preferred to TSC). Since the HPET has proven slower than ACPI-fast on some systems, drop its quality to 900. In the future, it is hoped that HPET performance will improve as it is the main timer Intel supports. HPET may move back to 2000 in -current once RELENG_7 is branched to ensure that it gets tested. Approved by: re --- sys/dev/acpica/acpi_hpet.c | 2 +- sys/dev/acpica/acpi_timer.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/dev/acpica/acpi_hpet.c b/sys/dev/acpica/acpi_hpet.c index f0efff38291..56a9c9c91f8 100644 --- a/sys/dev/acpica/acpi_hpet.c +++ b/sys/dev/acpica/acpi_hpet.c @@ -70,7 +70,7 @@ struct timecounter hpet_timecounter = { .tc_get_timecount = hpet_get_timecount, .tc_counter_mask = ~0u, .tc_name = "HPET", - .tc_quality = 2000, + .tc_quality = 900, }; static u_int diff --git a/sys/dev/acpica/acpi_timer.c b/sys/dev/acpica/acpi_timer.c index f83978e1c43..73bd5ed09e4 100644 --- a/sys/dev/acpica/acpi_timer.c +++ b/sys/dev/acpica/acpi_timer.c @@ -96,7 +96,7 @@ static struct timecounter acpi_timer_timecounter = { 0, /* no default counter_mask */ 0, /* no default frequency */ "ACPI", /* name */ - 1000 /* quality */ + -1 /* quality (chosen later) */ }; static u_int @@ -185,9 +185,11 @@ acpi_timer_probe(device_t dev) if (j == 10) { acpi_timer_timecounter.tc_name = "ACPI-fast"; acpi_timer_timecounter.tc_get_timecount = acpi_timer_get_timecount; + acpi_timer_timecounter.tc_quality = 1000; } else { acpi_timer_timecounter.tc_name = "ACPI-safe"; acpi_timer_timecounter.tc_get_timecount = acpi_timer_get_timecount_safe; + acpi_timer_timecounter.tc_quality = 850; } tc_init(&acpi_timer_timecounter);