Absolute timeouts and clock adjustments
Eric van Gyzen
vangyzen at FreeBSD.org
Tue Mar 14 19:17:55 UTC 2017
On 02/22/2017 03:21, Sebastian Huber wrote:
> Hello,
>
> I try to figure out how the timeout mechanisms work in current FreeBSD.
> My interpretation (which could be completely wrong) of POSIX is
> something like this should happen:
>
> now 2017-02-22
> sem_timedwait(s, 2023-12-13)
> external entity adjusts time to 2050-01-01
> timeout of sem_timedwait() occurs due to the time adjustment
>
> Inside the kernel all absolute timeouts seem to use the uptime.
[...]
> The abs_timeout_gethz() returns the interval length in ticks of
> [abstime->cur, abstime->end]. Since the msleep() uses the uptime, does
> this mean that timeouts trigger not immediately due to time adjustments
> in FreeBSD?
I just fixed this in 12-CURRENT. I'll merge it back to 11-STABLE in a
few weeks.
Eric
More information about the freebsd-hackers
mailing list