From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B584C33CAE for ; Mon, 13 Jan 2020 23:30:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 57D7920678 for ; Mon, 13 Jan 2020 23:30:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 57D7920678 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C42888E0005; Mon, 13 Jan 2020 18:30:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BF3DF8E0003; Mon, 13 Jan 2020 18:30:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B08EE8E0005; Mon, 13 Jan 2020 18:30:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0209.hostedemail.com [216.40.44.209]) by kanga.kvack.org (Postfix) with ESMTP id 97BEF8E0003 for ; Mon, 13 Jan 2020 18:30:15 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 3A50940D6 for ; Mon, 13 Jan 2020 23:30:15 +0000 (UTC) X-FDA: 76374206790.14.hands06_1f29d7628d640 X-HE-Tag: hands06_1f29d7628d640 X-Filterd-Recvd-Size: 4723 Received: from mail-oi1-f193.google.com (mail-oi1-f193.google.com [209.85.167.193]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Mon, 13 Jan 2020 23:30:13 +0000 (UTC) Received: by mail-oi1-f193.google.com with SMTP id 18so10049818oin.9 for ; Mon, 13 Jan 2020 15:30:13 -0800 (PST) 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=eZaqiw319VJnCml2+zBJxKWVWM0h/GzDX6yg9g2Rquw=; b=ZBpix0IPJXFO0U4TtQbXXYFkF4uhAlh7o0JS/OvvhIVj+xNfU7dG17WONgTN2QZ2uH 3xYOObMLtKiwVl+LCU9m7X1ZF9s5VMpC1I3InlRPOukHZ3yHE0oLKDUIv4Hzf5CNs1sh rgzJ7jK4djFPfQIDlw0dIXXb/m16f7xPcsioNFlZUlJs5zErLnC/aPGVjJGdCng2y1Dh FV5OIFCJP8QHWgFJ7uy71acqXE1rbJtkL7bX+L4wydCdMV6ojx7O0qNFOk1002Er4I8G e+LX9y39+4yP2BwItzKVE0SFExdcRQq4Tzs1VOLsrZvG2KxbfEX8YKHCuZ54IaJhD/o5 IxgA== X-Gm-Message-State: APjAAAVkJHlbHbX7n0fd2U0LNY1gQ58pyzp2YB2Mn/jeywbo3C1w3iq/ rluetHp1O7hF4sK2nKdf87Fw1JiuF95iUl9FmA0= X-Google-Smtp-Source: APXvYqzg8CdbzHzyG2pmz4js9Msb/H7pbgSPntduERaOQNPUZYVj+FwHMkNAuBIckeikwPmAWFV/f2vKNieGQbmMI6k= X-Received: by 2002:a54:488d:: with SMTP id r13mr14062187oic.115.1578958213346; Mon, 13 Jan 2020 15:30:13 -0800 (PST) MIME-Version: 1.0 References: <20200107234526.GA19034@dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com> <20200108105011.GY2827@hirez.programming.kicks-ass.net> <20200110153520.GC8214@u40b0340c692b58f6553c.ant.amazon.com> <20200113101609.GT2844@hirez.programming.kicks-ass.net> <857b42b2e86b2ae09a23f488daada3b1b2836116.camel@amazon.com> <20200113124247.GG2827@hirez.programming.kicks-ass.net> In-Reply-To: From: "Rafael J. Wysocki" Date: Tue, 14 Jan 2020 00:30:02 +0100 Message-ID: Subject: Re: [RFC PATCH V2 11/11] x86: tsc: avoid system instability in hibernation To: Peter Zijlstra Cc: "Singh, Balbir" , "Valentin, Eduardo" , "boris.ostrovsky@oracle.com" , "linux-kernel@vger.kernel.org" , "Agarwal, Anchal" , "Woodhouse, David" , "vkuznets@redhat.com" , "sstabellini@kernel.org" , "tglx@linutronix.de" , "linux-pm@vger.kernel.org" , "linux-mm@kvack.org" , "pavel@ucw.cz" , "axboe@kernel.dk" , "x86@kernel.org" , "roger.pau@citrix.com" , "hpa@zytor.com" , "rjw@rjwysocki.net" , "mingo@redhat.com" , "Kamata, Munehisa" , "bp@alien8.de" , "netdev@vger.kernel.org" , "konrad.wilk@oracle.co" , "len.brown@intel.com" , "davem@davemloft.net" , "fllinden@amaozn.com" , "xen-devel@lists.xenproject.org" Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Jan 13, 2020 at 10:50 PM Rafael J. Wysocki wrote: > > On Mon, Jan 13, 2020 at 1:43 PM Peter Zijlstra wrote: > > > > On Mon, Jan 13, 2020 at 11:43:18AM +0000, Singh, Balbir wrote: > > > For your original comment, just wanted to clarify the following: > > > > > > 1. After hibernation, the machine can be resumed on a different but compatible > > > host (these are VM images hibernated) > > > 2. This means the clock between host1 and host2 can/will be different > > > > > > In your comments are you making the assumption that the host(s) is/are the > > > same? Just checking the assumptions being made and being on the same page with > > > them. > > > > I would expect this to be the same problem we have as regular suspend, > > after power off the TSC will have been reset, so resume will have to > > somehow bridge that gap. I've no idea if/how it does that. > > In general, this is done by timekeeping_resume() and the only special > thing done for the TSC appears to be the tsc_verify_tsc_adjust(true) > call in tsc_resume(). And I forgot about tsc_restore_sched_clock_state() that gets called via restore_processor_state() on x86, before calling timekeeping_resume().