Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4442771ybl; Tue, 20 Aug 2019 11:59:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqxKASACi+h6AeQqaduw2++Rx12hZnMZgkGMjAPslM3hy2Fwg0W8oGhxEg8OB8/be65H+Vo2 X-Received: by 2002:a17:902:2ae9:: with SMTP id j96mr20546460plb.10.1566327585122; Tue, 20 Aug 2019 11:59:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566327585; cv=none; d=google.com; s=arc-20160816; b=H6JY/FFHX/egxgwYegZyCkbl2/+Gd/rf8zYr6HRY9z4/5591IO++LLgYJrkMjF6b0L OVc9gmJOdutKlS/0X6xTGSscf01lPy/n2gGo+JC4SKXzNa/yIlCKHnA6cDJK7phFVWfP BOT8EkvyJF2NkDfq0xS/nIwzQ3ZNj16sAqRXHsaKqg3NlH9v/dfSvaAnEG5j2PVlLz0r DE8EaQKA5j89s5Uh5qxFc3aQyQ0BFWP6qZn3ErkboDJwXk1NhCubraV/Ij/0RiXtXqaP 86oNUouQ2+ZirPQQ8jNlNv4MTGB296aw3+l6zLpMrMu/5zDrG5pSVSBClOQYpB7qQpPw ZU8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=uFt8hawtVbBgDIgA9fVBU2sEWiwcvnZa4v65r8b5lOk=; b=bXNohZkR2KP3uLPs0SSJKZgaRk9oRG2lXr197LtOoNaH503B0FWcYMrMBkHXbtf4JC c1ITXO1osjBQhGiA4ghLyNWEnKp4EHK3GyFLwmz0XX+7HygwCUlgsyGIVDLRvpZsD3D2 r8lTSjzl3WHlbf7Z7VukC408n7Z4/Gvs9bnebPim3LTIHexeW2y5x+JP/Vdql1232EMD D4wtYceAKJ2nd61XC0e9iFkDmA7Sv24L4XRbBmtVclxu1KV+I1r9qJ3ryAuOrmapF6uB hwU0qxBtYAI1Mb/rISFb/a3kQK4jpBNLHWeTrWxsgXHGgQM9UktPqgH5pLI07TVCII/o jMxw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v3si521063pjr.26.2019.08.20.11.59.29; Tue, 20 Aug 2019 11:59:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730330AbfHTS6e (ORCPT + 99 others); Tue, 20 Aug 2019 14:58:34 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:60437 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729231AbfHTS6e (ORCPT ); Tue, 20 Aug 2019 14:58:34 -0400 X-Originating-IP: 90.65.161.137 Received: from localhost (lfbn-1-1545-137.w90-65.abo.wanadoo.fr [90.65.161.137]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 7A583E000A; Tue, 20 Aug 2019 18:58:30 +0000 (UTC) Date: Tue, 20 Aug 2019 20:58:30 +0200 From: Alexandre Belloni To: Karel Zak Cc: Lennart Poettering , Arnd Bergmann , "Theodore Y. Ts'o" , Linus Torvalds , Linux Kernel Mailing List , Thomas Gleixner , John Stultz , Stephen Boyd , Florian Weimer , "H. Peter Anvin" , Palmer Dabbelt , Alistair Francis , GNU C Library , OGAWA Hirofumi Subject: Re: New kernel interface for sys_tz and timewarp? Message-ID: <20190820185830.GQ3545@piout.net> References: <20190814000622.GB20365@mit.edu> <20190814090936.GB10516@gardel-login> <20190814093208.GG3600@piout.net> <20190819110903.if3dzhvfnlqutn6s@ws.net.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190819110903.if3dzhvfnlqutn6s@ws.net.home> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/08/2019 13:09:03+0200, Karel Zak wrote: > On Wed, Aug 14, 2019 at 11:32:08AM +0200, Alexandre Belloni wrote: > > On 14/08/2019 11:09:36+0200, Lennart Poettering wrote: > > > On Mi, 14.08.19 10:31, Arnd Bergmann (arnd@arndb.de) wrote: > > > > > > > - glibc stops passing the caller timezone argument to the kernel > > > > - the distro kernel disables CONFIG_RTC_HCTOSYS, > > > > CONFIG_RTC_SYSTOHC and CONFIG_GENERIC_CMOS_UPDATE > > > > > > What's the benefit of letting userspace do this? It sounds a lot more > > > fragile to leave this syncing to userspace if the kernel can do this > > > trivially on its own. > > Good point, why CONFIG_RTC_SYSTOHC has been added to the kernel? > > If I good remember than it's because synchronize userspace hwclock > with rtc is pretty fragile and frustrating. We have improved this > hwclock code many times and it will never be perfect. See for example > hwclock --delay= option, sometimes hwclock has no clue about RTC behaviour. > With a bit of care, we can reliably set the rtc to the system time from userspace. It takes a bit of time (up to 2 seconds) but it can be reliably set with an accuracy of a few ms on a slow system and an rtc on a slow bus or a few ns with a fast system and a fast bus. I know I did say I would implement it in hwclock and I still didn't (sorry) but we could do better than the --delay option. > > It does it trivially and badly: > > > > - hctosys will always think the RTC is in UTC so if the RTC is in > > local time, you will anyway have up to 12 hours difference until > > userspace fixes that. > > Cannot we provide all necessary information for example on kernel > command line, or/and as rtc module option? > We could but from a distro point of view, would that be convenient? -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com