Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4442393ybl; Mon, 13 Jan 2020 13:52:22 -0800 (PST) X-Google-Smtp-Source: APXvYqwVUF+p5b9jotPvkQsmxTuNBV5P4KTYKuCkY4KjSgeL8a8bXLDDYT4Jv4LRJ3y5ven+n7vk X-Received: by 2002:aca:ef82:: with SMTP id n124mr14706051oih.88.1578952342605; Mon, 13 Jan 2020 13:52:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578952342; cv=none; d=google.com; s=arc-20160816; b=WB3coCumAqduMKcGsQuKJJkm2TDpJfaePDPqUbn9Pa0z98ZuKuE40RCkjuN1NH1/Oe 8gXK4NJ71K6/HV+s1YByNdmlbelpkhH3hepmQ2udK/cSbjBoiI+n/1sIANkEpsljSH4D mE7DUaHE6Wi4XfFfOrQI641Qzd/zQEoscby5OjrCTDM3YidOTzhfSjbVoOuTV9IJ6H0T bg9rkUFkz/IsFrg/zEdxc2fgz9fjoYb1Vq52Zfh9WbNSd/8nVBFylOE+1s8MoP/4Ke4q ojI7El2XwKu4jpSc04LjGBvG8IQiSKlIy9AivDTF3dIlGRi960gb2To68Yv4JHPdk6Lt g7+w== 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=ffKiZp7TgACphMkCDUm1FD5yMgsxVZ6Ff6N1urk4jWc=; b=Xpx1YktoMK0Uaq5abhVaYwXeijqDiy9Qh6lCyigNc2s789l3n9Ten5jCb/0UbLv8ly tMdGnrvkqRS5zuJcniIHJIErAVxBE43KWVqgw49GR/3DGecjoPQzL2DdVACS/SeN4MTy Eu+NoXWjOJxbPmGGdMdTBEHSvcZG7kX9SO5H+Ikf0Cl9j9+Orc1eoXWFIxn31914CYVH I0e19ID0+KfWWFzrvzI8iA/G2fAGicLzsfX16xAFvsVbm2uZZWWlJwIARtRMRtdfljI+ owworxfOCd4KWb3yfNXxqNaEfYE9XcAxOiQg3bIEeECZ3Ix4VFsMwa1rXzQP/7zemRDw Fenw== 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 n203si6338010oia.112.2020.01.13.13.52.10; Mon, 13 Jan 2020 13:52:22 -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 S1728863AbgAMVvM (ORCPT + 99 others); Mon, 13 Jan 2020 16:51:12 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:34788 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726488AbgAMVvL (ORCPT ); Mon, 13 Jan 2020 16:51:11 -0500 Received: by mail-ot1-f65.google.com with SMTP id a15so10514615otf.1; Mon, 13 Jan 2020 13:51:11 -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=ffKiZp7TgACphMkCDUm1FD5yMgsxVZ6Ff6N1urk4jWc=; b=deFlpVMUp8KPg/GoPHcDInQsdO2DE3pW1dltR5BS+dQWI6Zfumqd6IaxGvnF/jQNK1 JxwTl6yG5pKob2Kpni0NmwZhZMt+1baYy+a2n4sUXoO4h0ODYrNiynQ+AFJJh8y7jFGD 8rWlRFPMy0k3zS+LbblyK/w2r6Pk7XF7O0QgccnBy/WoJw6fII4AJehYAy3BC1TiR860 PWn9GpSkBlMQNVDGiS9c+DaGrC35F4w1Ya1GeThKk/NhzvwRpkcGzS/YUhkVfXNkhMTC DW7UFg/YXGBuirigcFU1mOPa3KhkHpvT5hOsfmPF+Zj7CYeIpiZTImxe9I5JTzM670Hn okKQ== X-Gm-Message-State: APjAAAWTuT559MLu0l1TK5pr1WjoB5TzR77tzOlIm3Oi+VkeOTL9o1dy PFWppNRUgL7xnF6VPL7FSPmBtfG7/gn5HoRrePo= X-Received: by 2002:a05:6830:4b9:: with SMTP id l25mr15083303otd.266.1578952270976; Mon, 13 Jan 2020 13:51:10 -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: <20200113124247.GG2827@hirez.programming.kicks-ass.net> From: "Rafael J. Wysocki" Date: Mon, 13 Jan 2020 22:50:59 +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" , "Woodhouse@dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com" , "linux-mm@kvack.org" , "jgross@suse.com" , "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 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(). > I remember some BIOSes had crazy TSC ideas for suspend2ram, and we grew > tsc_restore_sched_clock_state() for it. > > Playing crazy games like what you're doing just isn't it though. Right.