Re: [PATCH v2 4/4] hv_util: improve time adjustment accuracy by disabling interrupts
From: Stephen Hemminger
Date: Thu Jan 05 2017 - 12:40:45 EST
On Thu, 05 Jan 2017 13:35:58 +0100
Vitaly Kuznetsov <vkuznets@xxxxxxxxxx> wrote:
> I was thinking about it but to me what do_adjtimex() does looks too
> low-level for drivers (e.g. calling write_seqcount_begin(),
> __timekeeping_set_tai_offset(), tk_update_leap_state()). To me (again, I
> probably know not that much about time keeping) it looks like we'll have
> to have all this stuff around the __do_adjtimex() call here.
>
> Are there any particular concearns on calling do_adjtimex() directly?
With out holding timekeeper_lock, I don't see how you can do the adjtime
atomically. The userspace NTP doesn't worry about it, but in the kernel
you can be more accurate. But to do that you would need to write a new
function that is kernel specific.