]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Use per-cpu values for base and last in tc_cpu_ticks(). The values
authorKonstantin Belousov <kib@FreeBSD.org>
Fri, 25 Sep 2015 13:03:57 +0000 (13:03 +0000)
committerKonstantin Belousov <kib@FreeBSD.org>
Fri, 25 Sep 2015 13:03:57 +0000 (13:03 +0000)
commitb2557db60788104f972beac87630bafeff3c7721
tree55a3724048ed67c2e9f6fe36cc1bd5c6b2fe712a
parente675024a023fa6c17709a0241f7b5a29776b6330
Use per-cpu values for base and last in tc_cpu_ticks().  The values
are updated lockess, different CPUs write its own view of timecounter
state.  The critical section is done for safety, callers of
tc_cpu_ticks() are supposed to already enter critical section, or to
own a spinlock.

The change fixes sporadical reports of too high values reported for
the (W)CPU on platforms that do not provide cpu ticker and use
tc_cpu_ticks(), in particular, arm*.

Diagnosed and reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
sys/kern/kern_tc.c