From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S939504AbdAINFj (ORCPT ); Mon, 9 Jan 2017 08:05:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50700 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760824AbdAINDF (ORCPT ); Mon, 9 Jan 2017 08:03:05 -0500 From: Vitaly Kuznetsov To: John Stultz Cc: "devel\@linuxdriverproject.org" , lkml , "K. Y. Srinivasan" , Haiyang Zhang , Thomas Gleixner , Alex Ng , Stephen Hemminger Subject: Re: [PATCH v2 1/4] timekeeping: export do_adjtimex() to modules References: <20170104172439.19683-1-vkuznets@redhat.com> <20170104172439.19683-2-vkuznets@redhat.com> Date: Mon, 09 Jan 2017 14:03:02 +0100 In-Reply-To: (John Stultz's message of "Fri, 6 Jan 2017 17:06:43 -0800") Message-ID: <877f648jy1.fsf@vitty.brq.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 09 Jan 2017 13:03:05 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org John Stultz writes: > On Wed, Jan 4, 2017 at 9:24 AM, Vitaly Kuznetsov wrote: >> While do_adjtimex() is available to userspace via adjtimex syscall it is >> not available to modules which may want to implement in-kernel 'NTP >> clients'. Hyper-V hv_utils is going to be the first one. >> >> Signed-off-by: Vitaly Kuznetsov >> --- >> kernel/time/timekeeping.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c >> index da233cd..ae4f24f 100644 >> --- a/kernel/time/timekeeping.c >> +++ b/kernel/time/timekeeping.c >> @@ -2312,6 +2312,7 @@ int do_adjtimex(struct timex *txc) >> >> return ret; >> } >> +EXPORT_SYMBOL_GPL(do_adjtimex); > > No real objections to this, although I do want to better understand > the benefits (and drawbacks) of doing the adjtimex in the kernel > driver rather then via userspace, to make sure the need is sane. > Thank you for your comments John, An alternative approach would be to make this module export an interface for userspace and implement a daemon which would do adjtimex syscalls. In theory this could be a part of an NTP client though I don't think that NTP clients will want to accept such 'alternative' way of getting time. -- Vitaly