Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1737002imm; Tue, 2 Oct 2018 13:07:55 -0700 (PDT) X-Google-Smtp-Source: ACcGV606sAaNN4ArnYT+zN05XFdNFGv1NKyCKf43/RwmA894++P95DBlAqRrFZiMhi5FFcX7w4vR X-Received: by 2002:a63:89c1:: with SMTP id v184-v6mr15427315pgd.79.1538510875398; Tue, 02 Oct 2018 13:07:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538510875; cv=none; d=google.com; s=arc-20160816; b=JvOeW7TPZsa1BBkSFLsWdMUhhWsEV4vTUzKwOch2Jp5YF3P5DueLMpT6HyyeDMKFkE Yworf6tse4GlZvDIlbjZbSwKHNPrluR9SGbXtSXdfI4ReDC9JkjI9++MPHIz3hC+9Rvq AsaRe5610d8fRNh6ZUfoL2mmXZfloYJNAr1+6RWKSDOt8ClJeFyTj3ZdP5BGM0jBsB9v clKUR5X2P/KZ2yRfavU02Jfp1DpfvDtV/cY5KzTMlvYFA3nFbPm2MCSucQRphAmfThLo 7+z2qS8uAdWfE37XDvSHCIWAWsOaPSAXy+3fwGqc+3ncBy7aAUI4pqTwzlwEXptPCFPp C5YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=tUM3Wa450f2G7uNcKpIZ84B+FoCkq+hVwrcpzN0+mQg=; b=alXc7zKTvaOrFYjry+Ym0ZgczYPV+3y0OjlBIiDN7CK0Fv7XNfyXFXyYOQNNLRwlPs qrZBtqUKfcCVXXJ9qJSAuTXm3wOMBHV6eLFa9rSbaEZoQrgk48RSQASOTgRMrEwvbcd1 La9OuV3/IjcRPja2V/y+MlReoAtwhhikzbajrLCOlOTYuc5wKPP1PxT96y1LrbbYuwFX QkUPABbRRGTzaPs3S1IjcV4Ca7I4C/hiX7WZ54+Jv3hIt2rKZQ9EKwQuQLD+vojSz29e gdzIQPXOQxaHtldOqiiTuahaeercxfvld3EKSlO0CDhqXkjYC8lK+KHQlKcnL6Wa3sFS 1ldQ== 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 r6-v6si18570512pfc.253.2018.10.02.13.07.39; Tue, 02 Oct 2018 13:07:55 -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 S1727562AbeJCCwE (ORCPT + 99 others); Tue, 2 Oct 2018 22:52:04 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:60946 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726194AbeJCCwE (ORCPT ); Tue, 2 Oct 2018 22:52:04 -0400 Received: from p5492e4c1.dip0.t-ipconnect.de ([84.146.228.193] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1g7Qw9-0002Lg-Jv; Tue, 02 Oct 2018 22:06:29 +0200 Date: Tue, 2 Oct 2018 22:06:28 +0200 (CEST) From: Thomas Gleixner To: Arnd Bergmann cc: "Eric W . Biederman" , avagin@virtuozzo.com, dima@arista.com, Linux Kernel Mailing List , 0x7f454c46@gmail.com, adrian@lisas.de, Andy Lutomirski , Christian Brauner , gorcunov@openvz.org, "H. Peter Anvin" , Ingo Molnar , Jeff Dike , Oleg Nesterov , xemul@virtuozzo.com, Shuah Khan , containers@lists.linux-foundation.org, criu@openvz.org, Linux API , the arch/x86 maintainers , Alexey Dobriyan , linux-kselftest@vger.kernel.org Subject: Re: Setting monotonic time? In-Reply-To: Message-ID: References: <20180919205037.9574-1-dima@arista.com> <874lej6nny.fsf@xmission.com> <20180924205119.GA14833@outlook.office365.com> <874leezh8n.fsf@xmission.com> <20180925014150.GA6302@outlook.office365.com> <87zhw4rwiq.fsf@xmission.com> <87mus1ftb9.fsf@xmission.com> <877ej2xc23.fsf_-_@xmission.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2 Oct 2018, Arnd Bergmann wrote: > On Mon, Oct 1, 2018 at 8:53 PM Thomas Gleixner wrote: > > > > On Mon, 1 Oct 2018, Eric W. Biederman wrote: > > > In the context of process migration there is a simpler subproblem that I > > > think it is worth exploring if we can do something about. > > > > > > For a cluster of machines all running with synchronized > > > clocks. CLOCK_REALTIME matches. CLOCK_MONOTNIC does not match between > > > machines. Not having a matching CLOCK_MONOTONIC prevents successful > > > process migration between nodes in that cluster. > > > > > > Would it be possible to allow setting CLOCK_MONOTONIC at the very > > > beginning of time? So that all of the nodes in a cluster can be in > > > sync? > > > > > > No change in skew just in offset for CLOCK_MONOTONIC. > > > > > > There are also dragons involved in coordinating things so that > > > CLOCK_MONOTONIC gets set before CLOCK_MONOTONIC gets used. So I don't > > > know if allowing CLOCK_MONOTONIC to be set would be practical but it > > > seems work exploring all on it's own. > > > > It's used very early on in the kernel, so that would be a major surprise > > for many things including user space which has expectations on clock > > monotonic. > > > > It would be reasonably easy to add CLOCK_MONONOTIC_SYNC which can be set in > > the way you described and then in name spaces make it possible to magically > > map CLOCK_MONOTONIC to CLOCK_MONOTONIC_SYNC. > > > > It still wouldn't allow to have different NTP/PTP time domains, but might > > be a good start to address the main migration headaches. > > If we make CLOCK_MONOTONIC settable this way in a namespace, > do you think that should include device drivers that report timestamps > in CLOCK_MONOTONIC base, or only the timekeeping clock and timer > interfaces? Uurgh. That gets messy very fast. > Examples for drivers that can report timestamps are input, sound, v4l, > and drm. I think most of these can report stamps in either monotonic > or realtime base, while socket timestamps notably are always in > realtime. > > We can probably get away with not setting the timebase for those > device drivers as long as the checkpoint/restart and migration features > are not expected to restore the state of an open character device > in that way. I don't know if that is a reasonable assumption to make > for the examples I listed. No idea. I'm not a container migration wizard. Thanks, tglx