DragonFly BSD
DragonFly commits List (threaded) for 2013-06
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

git: clock/tsc: Detect invariant TSC CPU synchronization


From: Sepherosa Ziehau <sephe@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 19 Jun 2013 20:19:53 -0700 (PDT)

commit dda44f1e92d93dc26b3445bdc61b11c3fda8733d
Author: Sepherosa Ziehau <sephe@dragonflybsd.org>
Date:   Thu Jun 20 11:10:03 2013 +0800

    clock/tsc: Detect invariant TSC CPU synchronization
    
    The detected result could be used to determine whether TSC could be
    used as cputimer or not, and could be used by other stuffs, e.g.
    CoDel AQM packet time stamping.
    
    - Only invariant TSC will be tested
    - If there is only one CPU, then invariant TSC is always synchronized
    - Only CPUs from Intel are tested (*)
    
    The test is conducted using lwkt_cpusync interfaces:
    BSP read the TSC, then ask APs to read TSC.  If TSC read from any APs
    is less then the BSP's TSC, the invariant TSC is not synchronized
    across CPUs.
    
    Currently the test runs ~100ms.
    
    (*)
    AMD family 15h model 00h-0fh may also have synchronized TSC across
    CPUs as pointed out by vsrinivas@, however, according to AMD:
    
      <Revision Guide for AMD Family 15h Models 00h-0Fh Processors
       Rev. 3.18 October 2012>
      759 One Core May Observe a Time Stamp Counter Skew
    
    AMD family 15h model 00h-0fh is _not_ ready yet.

Summary of changes:
 sys/platform/pc32/include/clock.h          |  1 +
 sys/platform/pc32/isa/clock.c              | 86 ++++++++++++++++++++++++++++++
 sys/platform/pc64/include/clock.h          |  1 +
 sys/platform/pc64/isa/clock.c              | 86 ++++++++++++++++++++++++++++++
 sys/platform/vkernel/include/clock.h       |  1 +
 sys/platform/vkernel/platform/init.c       |  3 ++
 sys/platform/vkernel/platform/systimer.c   |  2 +
 sys/platform/vkernel64/include/clock.h     |  1 +
 sys/platform/vkernel64/platform/init.c     |  3 ++
 sys/platform/vkernel64/platform/systimer.c |  2 +
 10 files changed, 186 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/dda44f1e92d93dc26b3445bdc61b11c3fda8733d


-- 
DragonFly BSD source repository



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]