devstat overhead VS precision

Pawel Jakub Dawidek pjd at FreeBSD.org
Mon Apr 15 19:35:22 UTC 2013


On Mon, Apr 15, 2013 at 10:18:15PM +0300, Konstantin Belousov wrote:
> On Mon, Apr 15, 2013 at 08:42:03PM +0200, Pawel Jakub Dawidek wrote:
> > On a mostly unrelated note when two threads (T0 and T1) call get*time()
> > on two different cores, but T0 does that a bit earlier is it possible
> > that T0 can get later time than T1?
> 
> Define earlier first.
> 
> If you have taken sufficient measures to prevent preemption and interruption,
> e.g. by entering spinlock before the fragment that calls get*, then no,
> it is impossible, at least not with any x86 timekeeping hardware we use.
> 
> On the other hand, if interrupts are allowed, all bets are off.

So if we consider only one thread, it is not possible for it to obtain
time t0, be scheduled to different CPU and obtain t1 where t1 < t0?

-- 
Pawel Jakub Dawidek                       http://www.wheelsystems.com
FreeBSD committer                         http://www.FreeBSD.org
Am I Evil? Yes, I Am!                     http://mobter.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20130415/5feaf994/attachment.sig>


More information about the freebsd-geom mailing list