Re: adjusting the monotonic system time (from inside the kernel)

From: Alexander Holler
Date: Mon May 06 2013 - 11:06:14 EST


Am 06.05.2013 16:02, schrieb Alexander Holler:

>
> But I would prefer the following:
>
> hw-clock --> kernel -> system-time
>
> Problem is that the hw-clock in question doesn't offer something like a
> tick. It just might send a timestamp with millisecond precision whenever
> it wants.
>
> Because I don't want to reinvent the wheel and because I think there are
> some people which already have spend some thoughts on similiar things,
> I'm asking here before I try to implement something which then never
> might find it's way into the mainline kernel.
>
> Any hints, suggestions, whatever?

To offer something for discussion I'm thinking about:

When a timestamp with millisecond precision is received, instruct the
kernel to adjust the system time in the next minute for the calculated
offset.

Question here would be what to choose as window to adjust the time (the
"next minute" above"). I think that should depend on the offset. But
what are acceptable values? One minute to adjust the clock for offsets
up to +-500ms? Two minutes if the offset is one second? ...

As I never spend a thought about such before, I just don't have any
pointers what would be acceptable.

Regards,

Alexander
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/