Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4265034img; Tue, 26 Mar 2019 06:19:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqw3ktQ7v9VBM4qHJNDW6hkG7dGUcJovA4QG1vAcg1sEZ1LHdly9ttH4irYG/g9IqPh+yzh9 X-Received: by 2002:a17:902:290b:: with SMTP id g11mr31157286plb.269.1553606381759; Tue, 26 Mar 2019 06:19:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553606381; cv=none; d=google.com; s=arc-20160816; b=00iedhI7xecyqdWvZ3IGAbsBwHQ+4A5p8hzpqT6L3yVyfJwB7PSWHAID0jarX2w3v4 e52+CCfzLU4aYVSknHs2aKOJQGcMxJGAVyvEumb28j1E732s6C6dNM87aSob6gi1Y9w2 PrYnzv0cAb1h8ftOS7SGMgXr2K4NIyyHvEBYsmyNCm1ewjTn0j3IzCMDp4BEgJZAqyeN hrcOphaMRIJKXMzWO+W0oWe9YPW9ZisljHTrJYnZuisuIikSPjuk/oReT6hpfn7gZ0mc DCCf5TGsQIjlNPDjnWv4hSPhPjNnMMNCXwN4K+NSXBh6ttbqyc7oOBzzsyypfymDZ7qY qbNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=4J2pUja7yQCOBPtzRhzCuOwHzcJHjeyBts/dk/OYpQg=; b=BVDjULifTaKozrfWQA44kQWmGt9xJaKsd6nxuMs9sv7zCOiXRLLEVusfemILAH+Vc+ yj9RUURNcoLq/6TX3dCyYLVwj5Wo+QG1q7zTTT+ZAMUc8ZoHhjLZKAlQ/AQEjdWD9O4Y F3N2KQMHZqeisz8AU4EbM+Ewrq2bs1Sulr6Yyj1tYDzjjowuuLztUDhuODdDwY1Chd1L eugB4yAj/sXGNXIZnm/kaDeqZL0MCi45bX7Pq0gvWPe6y9voisR1AdKVc6da/9zBWNLc Fa0cHGAWFZFZIvrRRHOFfZSLwtBEvYtvvL9J/nqycG2eUI7++ZPjkvpd5bzkfO+/yBWt szAg== 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 e10si15861170pgm.298.2019.03.26.06.19.26; Tue, 26 Mar 2019 06:19:41 -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 S1731595AbfCZNRI (ORCPT + 99 others); Tue, 26 Mar 2019 09:17:08 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:38202 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726175AbfCZNRG (ORCPT ); Tue, 26 Mar 2019 09:17:06 -0400 Received: by mail-qt1-f193.google.com with SMTP id d13so9755804qth.5 for ; Tue, 26 Mar 2019 06:17:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4J2pUja7yQCOBPtzRhzCuOwHzcJHjeyBts/dk/OYpQg=; b=EjFi2pXugjo7oiTO8SqyFtLzUDIT3Rlzww/VL9dwPFq7EF4Ha4M11c6HMKqQyY7HUm 2AtfIh+6i+sIIPWla4XQz7lWWsKt/BUWO/9L5G1GI8PVECJ7yLR0c1gTUwRskxNPYpWE ooxkTWPmr0tlJAwzGDf67JaU7aLGpJVBJfn2EP4AbiQVOjKL9Ntk6RygrVTVShTsNJhM +59/fuJbQX4v4Kogc3tJGEyDb0BpkuAy/jMTviuk9EnpajrpV8geKS0spG8e6IF5pcoJ giHGMrR4T80vMI2A+3jJw/IhNCs6+9J6g+MR8o0ogqxYCSupJPdamznkYReZcXsVzTbL /dTg== X-Gm-Message-State: APjAAAWyS+Vp74HHg1dNS8sm0zcGfDSbTAy6OxNFV/sFDSL2hAQbpWFS 9CHNWoUnxA4cBTKAZ3zVJ3SviOW8VZkUxI7JZR4= X-Received: by 2002:a0c:9487:: with SMTP id j7mr24698045qvj.180.1553606225300; Tue, 26 Mar 2019 06:17:05 -0700 (PDT) MIME-Version: 1.0 References: <20190326092607.GE14186@localhost> In-Reply-To: From: Arnd Bergmann Date: Tue, 26 Mar 2019 14:16:47 +0100 Message-ID: Subject: Re: [PATCH] timekeeping: Force upper bound for setting CLOCK_REALTIME To: Thomas Gleixner Cc: Miroslav Lichvar , LKML , John Stultz , Stephen Boyd , Richard Cochran , Hongbo Yao , Xiongfeng Wang , Peter Zijlstra Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 26, 2019 at 1:31 PM Thomas Gleixner wrote: > > On Tue, 26 Mar 2019, Miroslav Lichvar wrote: > > On Sat, Mar 23, 2019 at 11:36:19AM +0100, Thomas Gleixner wrote: > > > It is reasonable to force an upper bound for the various methods of setting > > > CLOCK_REALTIME. Year 2262 is the absolute upper bound. Assume a maximum > > > uptime of 30 years which is plenty enough even for esoteric embedded > > > systems. That results in an upper bound of year 2232 for setting the time. > > > > The patch looks good to me. > > > > I like this approach better than using a larger value closer to the > > overflow (e.g. one week) and stepping the clock back automatically > > when the clock reaches that time, but I suspect it might possibly > > break more tests (or any unusual applications messing with time) as a > > much larger interval is now EINVAL. > > I'm fine with breaking a few tests on the way rather than having undefined > behaviour and the constant flow of patches tackling the wrong end of the > stick. I think the one downside of your approach is that it introduces a second arbitrary cut-off point after which the system almost functions perfectly, but is no longer able to do ntp updates or set the right time after a reboot. That said, all other ideas I've managed to come up with are worse, so I agree on going ahead with this version. We could still bikeshed over the exact cutoff time, as the one you picked isn't particularly intuitive. It's almost exactly 30 years before the final end point, but your calculation is off by a few days because of leap years. And no, I don't have a particular preference for any other color of this bikeshed either, it's probably as good as any other time within 20 years of what you suggested. Arnd