Make timehands count selectable at boottime?
Sebastian Huber
sebastian.huber at embedded-brains.de
Wed Oct 2 06:48:39 UTC 2019
On 01/10/2019 16:37, Konstantin Belousov wrote:
> On Tue, Oct 01, 2019 at 12:48:46PM +0200, Sebastian Huber wrote:
>> Hello,
>>
>> a recent commit made the timehands count selectable at boottime:
>>
>> https://reviews.freebsd.org/D21563
>>
>> What was the reason for this change?
>
> See the followup thread on the svn-src@ list for this revision.
Thanks for the hint. So, this change is related to the PPS handling and
the things which happen between a pps_capture() and pps_event().
What I don't understand is why more timehands are a problem for the
consumer side. For example:
void
binuptime(struct bintime *bt)
{
struct timehands *th;
u_int gen;
do {
th = timehands;
gen = atomic_load_acq_int(&th->th_generation);
*bt = th->th_offset;
bintime_addx(bt, th->th_scale * tc_delta(th));
atomic_thread_fence_acq();
} while (gen == 0 || gen != th->th_generation);
}
With more timehands the time frame in which th->th_generation remains
constant is longer the more timehands you have. So, it is less likely
that you have to execute the loop body twice. The count of timehands is
limited by the timecounter frequency and mask, and the hz configuration.
--
Sebastian Huber, embedded brains GmbH
Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : sebastian.huber at embedded-brains.de
PGP : Public key available on request.
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
More information about the freebsd-hackers
mailing list