From 0405a5efe79e095113badf3dabda0526966a02a6 Mon Sep 17 00:00:00 2001 From: Jung-uk Kim Date: Fri, 13 Aug 2010 22:08:42 +0000 Subject: [PATCH] Reset switchtime to zero rather than the current CPU ticker (TSC) value. It is more appropriate in this context because TSC MSR is reset to zero when the CPU is restarted from S3 and above. Move acpi_resync_clock() back to where it was before r211202. It does not make a difference any more. --- sys/amd64/acpica/acpi_wakeup.c | 4 ++-- sys/amd64/amd64/mp_machdep.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/amd64/acpica/acpi_wakeup.c b/sys/amd64/acpica/acpi_wakeup.c index bff80455544..9afb36ca36a 100644 --- a/sys/amd64/acpica/acpi_wakeup.c +++ b/sys/amd64/acpica/acpi_wakeup.c @@ -278,13 +278,13 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) for (;;) ia32_pause(); } else { - acpi_resync_clock(sc); - PCPU_SET(switchtime, cpu_ticks()); + PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); #ifdef SMP if (wakeup_cpus != 0) acpi_wakeup_cpus(sc, wakeup_cpus); #endif + acpi_resync_clock(sc); ret = 0; } diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index 7ea4d7d79fe..034ae77cc82 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -1366,7 +1366,7 @@ cpususpend_handler(void) wbinvd(); atomic_set_int(&stopped_cpus, cpumask); } else { - PCPU_SET(switchtime, cpu_ticks()); + PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); }