[Python-checkins] peps: PEP 418: Add CLOCK_BOOTTIME and FreeBSD kern.timecounter.hardware sysctl

victor.stinner python-checkins at python.org
Tue Apr 10 18:03:05 CEST 2012


http://hg.python.org/peps/rev/94793b715d71
changeset:   4211:94793b715d71
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Tue Apr 10 13:58:42 2012 +0200
summary:
  PEP 418: Add CLOCK_BOOTTIME and FreeBSD kern.timecounter.hardware sysctl

files:
  pep-0418.txt |  29 ++++++++++++++++++++++++++++-
  1 files changed, 28 insertions(+), 1 deletions(-)


diff --git a/pep-0418.txt b/pep-0418.txt
--- a/pep-0418.txt
+++ b/pep-0418.txt
@@ -260,7 +260,9 @@
 * TSC (Time Stamp Counter): Historically, the TSC increased with every internal
   processor clock cycle, but now the rate is usually constant (even if the
   processor changes frequency) and usually equals the maximum processor
-  frequency. The instructor RDTSC can be used to read this counter.
+  frequency. Multiple cores having different TSC values. Hibernation of system
+  will reset TSC value. The instructor RDTSC can be used to read this counter.
+  CPU frequency scaling for power saving.
 * ACPI PMTMR (power management timer): ACPI 24-bit timer with a frequency
   of 3.5 MHz (3,579,545 Hz). HPET can cause around 3 seconds of drift per day.
 * Cyclone: The Cyclone timer uses a 32-bit counter on IBM Extended
@@ -788,6 +790,31 @@
 <http://www.kernel.org/doc/man-pages/online/pages/man7/time.7.html>`_:
 "overview of time and timers".
 
+FreeBSD timers
+--------------
+
+The sysctl program can be used to change the timecounter. For example::
+
+    # sysctl kern.timecounter.hardware="ACPI-fast"
+    kern.timecounter.hardware: HPET -> ACPI-fast
+
+
+Sleep, suspend and monotonic time
+=================================
+
+Linux
+-----
+
+On Linux, CLOCK_MONOTONIC and CLOCK_MONOTONIC_RAW includes time the system
+spends in sleep; but it does not include time spent in hibernation (ACPI S3
+mode). If the system clock jumps backward, CLOCK_MONOTONIC and
+CLOCK_MONOTONIC_RAW are not affected.
+
+Linux 2.6.39 and glibc 2.14 introduces a new clock: CLOCK_BOOTTIME.
+CLOCK_BOOTTIME is idential to CLOCK_MONOTONIC, except it also includes any time
+spent in suspend. Read also `Waking systems from suspend
+<http://lwn.net/Articles/429925/>`_ (March, 2011).
+
 
 Sleeping
 ========

-- 
Repository URL: http://hg.python.org/peps


More information about the Python-checkins mailing list