Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4533404ybl; Mon, 13 Jan 2020 15:37:16 -0800 (PST) X-Google-Smtp-Source: APXvYqz0v4kON8gwJco3rpch0PZgHpMslPHtb+OSHDMK1tyKg2exkhxdfqoZ4eg3KyvenWrczTV0 X-Received: by 2002:a9d:6314:: with SMTP id q20mr15217057otk.3.1578958636485; Mon, 13 Jan 2020 15:37:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578958636; cv=none; d=google.com; s=arc-20160816; b=TfaKzLGEp23d2Dd/cJCyn36GL/y9N9PWWoykp748L0jsSRfn80yHLNPPC+ZzZ52FOa QtOCmeP7P4/RAJxGCuR2E5wovW/QXCDWeB6uCr0dB9Mmg6cU+tF/SLW2i9bmtHo/ppI6 RCM0GWFi3cEKv/N1myG5QThqeC580A/QU4PYFEx3+bSeA/zhEBR2mXbvAalxQABXrOFk XDw7kQKkweQH6QnUGhXQ+CdUg3PVAlugi7E1gWU4nEeJ/qyLnfvN1Fkuvmz9oKZuf59k aYZ4VIDn/k+/z8H1XHQT4iUvr7rvotLznqGpWaey2NAXcIS7tQHlv//jRsk51Obo/Ysd cFfA== 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=eZaqiw319VJnCml2+zBJxKWVWM0h/GzDX6yg9g2Rquw=; b=w+x6R8gxHLS0FtsC5LvzB7CRkO7tKFunkAv8GSdg/SHAGQ7AxszoPuovHzG9L3ujGo a+c5dMANcwbRkij8k5yhnykoGfiPN2Osvdi4ovUahmN6/cP+t7eQtnvvMejs/2I0BxWm P9Mahth7SiF6MJFfLJW0CzzlGMWzJi2GRCQDPTESolXPaebibFgLAmD8hG8fZRuk/cvF Bk7wQWZXr5KtAllzlhOMEwQtN1K+rfulwZcVXzRifJxoSCrRMYxS4Hc5SLdok9hgCj/1 qjxes5t0bxFJoshIYztxg5VneLJ5OvClpQGwJ5L+gOGmUYyn25/pRtSTFWUOTU3ub/jf uiRQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2si7096825otn.117.2020.01.13.15.37.04; Mon, 13 Jan 2020 15:37:16 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729027AbgAMXaO (ORCPT + 99 others); Mon, 13 Jan 2020 18:30:14 -0500 Received: from mail-oi1-f193.google.com ([209.85.167.193]:39897 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727282AbgAMXaO (ORCPT ); Mon, 13 Jan 2020 18:30:14 -0500 Received: by mail-oi1-f193.google.com with SMTP id a67so10073685oib.6; 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=azLS09kg+Uk/fO35rdud1DlwwVzPiuH5S7OM5V8SHMM5D1fX8rwNxsfx5M1Upshs+x 0mmpxoqHrsRoGKlrc2LaQ9ALZ5Tv5iN9HBPMjsA+lijecPUDoArwpyRyjiMfX4gWYhWH tnHnmmWYyMRk32sf3/9XeSbBwTSik4C8ZZ5ujulGD44lATnZAh4e/T5O0MyTCrPF2PDB w75OLfRqIHlkMi8E0Zwu7VC+pviVK6P6BYtSeqMtWNKgENiJJbuarQ/aAwGc/ZHfzBgC HDTdjeMqkLJ8EDBoNjjiItfXwNPhsWMKGew3+TvvO1zX4ts5zBy8ovtPl32hBX+SFwpX 4Gvw== X-Gm-Message-State: APjAAAU1JDj8op1wzhwlKWHFacauqx2P6d5pm6Ko/Ch3+91PR+kVzJYW xlI/Zg5qmtDa+3YYmupKpVPTBJCiKKxNj5CHAI8= 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" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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().