From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751957AbdAERkm (ORCPT ); Thu, 5 Jan 2017 12:40:42 -0500 Received: from mail-pg0-f41.google.com ([74.125.83.41]:34640 "EHLO mail-pg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752885AbdAERjW (ORCPT ); Thu, 5 Jan 2017 12:39:22 -0500 Date: Thu, 5 Jan 2017 09:39:13 -0800 From: Stephen Hemminger To: Vitaly Kuznetsov Cc: devel@linuxdriverproject.org, linux-kernel@vger.kernel.org, "K. Y. Srinivasan" , Haiyang Zhang , John Stultz , Thomas Gleixner , Alex Ng Subject: Re: [PATCH v2 4/4] hv_util: improve time adjustment accuracy by disabling interrupts Message-ID: <20170105093913.48d09249@xeon-e3> In-Reply-To: <87o9zladld.fsf@vitty.brq.redhat.com> References: <20170104172439.19683-1-vkuznets@redhat.com> <20170104172439.19683-5-vkuznets@redhat.com> <20170104111749.0e7d566e@xeon-e3> <87o9zladld.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 05 Jan 2017 13:35:58 +0100 Vitaly Kuznetsov 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.