Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Feb 2017 15:26:28 -0600
From:      Eric van Gyzen <vangyzen@FreeBSD.org>
To:        Ian Lepore <ian@freebsd.org>, Sebastian Huber <sebastian.huber@embedded-brains.de>, FreeBSD <freebsd-hackers@freebsd.org>
Subject:   Re: Absolute timeouts and clock adjustments
Message-ID:  <bb91620e-8fbf-db73-82ca-704ea01a182d@FreeBSD.org>
In-Reply-To: <1487778365.73144.144.camel@freebsd.org>
References:  <58AD5802.30908@embedded-brains.de> <1ff4d78a-a157-53c5-af7e-b516bc1b6187@FreeBSD.org> <1487778365.73144.144.camel@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> Using CLOCK_MONOTONIC doesn't avoid the issue, it just explicitly asks
> for the current behavior.  If the behavior you need is to wake up when
> CLOCK_REALTIME exceeds some value, you're still screwed.
>
> It would be easy enough to fix the current behavior by adding something
> like "if (timo > hz) timo = hz;" to the existing loop so that
> CLOCK_REALTIME gets re-checked once a second.

That would work, but I don't really like introducing spurious wakeups just to 
handle a very rare event.

How about this approach?

	https://reviews.freebsd.org/D9791

It's also not ideal, and it's obviously much larger than your suggestion, but 
it's very cheap in the common paths.

Eric



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bb91620e-8fbf-db73-82ca-704ea01a182d>