Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3710043imm; Mon, 30 Jul 2018 01:56:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeSzVhaj92f0vzcZL10oytKNwXBHaIxrT/+V5Q+gKFnnfNOWwrb5e6Cw+1kYIt5HidGiTUz X-Received: by 2002:a17:902:7147:: with SMTP id u7-v6mr15449417plm.154.1532941000985; Mon, 30 Jul 2018 01:56:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532941000; cv=none; d=google.com; s=arc-20160816; b=SXpiXRIF7H9sbrALaMLKSPajmWBWRvNAjXS6a+xbbQv2M8UabjRd39M3Y6S12xRtPC WWNJ8/dh5YxPmaohztwCTUHVzp/Oy8yA0d3P8j+L2XuJ7z0KYMhuqAdL6bhpngYYEbMw Y1l0GCIP9wdTYvJkhFvTWifdal1VRPa/enbEu+DHiR1htMJjy6SK+zQXvUsJOKfW5/WC yfTeKJmu03oGM6xQRlvA4077zzHV9QUrGb9TzvQi37rFarDAGkAUW/8qU64DyzvezFdJ MAPzOVLbm83lb9xkYJP2qO51nsneQZxOe08ywvD4qQgr5uJUl7Zj2WWM31ZRb21V1pN9 hY1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=xdGnmK8t1YV0QPYIjo0ZqGbctDl195gyFDUuKKzBSiE=; b=LUN/qeaEAGjGghF6V+wCk1KCPXW89UG9huYkhhr4kEed5cuE6wZmTRR9/bEPq/sy4x 8tNzF9SWjWIDrWWRbZD4kVmAfxUr5EnDZqw/6YGOSN6lmwb2ZBsF7Um3WVL/KXbfEihh V1uda0GAgVgSGf8LBQNL3kR4Ux5SRxItoENQ9N1pLUomyQP2HLtapBllaL/rwk9iMCuh IYD7OYLk2/Ni0ih4MD1ELTb4UvS1ya6qTccVqDgI08dDbyt8Vp1/nC0aWR/RX49JYmz1 3Xy3hdNTHc72Q4HOsPIzYRYkf8i8KY/tAM+w0pcJPz25btQsCF9s2jLkNqQuahYw+vfE Do8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=k3l2qA0S; 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 m11-v6si9808193pla.45.2018.07.30.01.56.26; Mon, 30 Jul 2018 01:56:40 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=k3l2qA0S; 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 S1726828AbeG3K23 (ORCPT + 99 others); Mon, 30 Jul 2018 06:28:29 -0400 Received: from merlin.infradead.org ([205.233.59.134]:40544 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726543AbeG3K22 (ORCPT ); Mon, 30 Jul 2018 06:28:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=xdGnmK8t1YV0QPYIjo0ZqGbctDl195gyFDUuKKzBSiE=; b=k3l2qA0SGymJzCLwS3/427W9+ Mt1KB9QnpGlV0RXLV3wfPRg4JItAY7UsFUZKBCCIso1z0kHLiVCrK3/URK2zI5sLKj07qovsI1rvJ N29mOgq3WdSqLQp5ZjN1J+Vf+zTRquNI/ij5DEGRffFB18eYlebPZfys0kdPdcudAmJho/XMrU9y7 eay5Zpbgx+hvuQW4uKK1TUNYeiFRE1BGIGmpuRe76UV23cZZHQZyrHLxiNKQi2k18emDYpvy+xJSI W+51pgllsmCBD4ref9MXtaLZRKb1u43TougfwTxOihjSR8AnUi25AY0ZeMU5mn+ZRpiPAiMb3o5NP M7yKp8A0Q==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fk3wE-0005Bk-6e; Mon, 30 Jul 2018 08:53:58 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 0538420268325; Mon, 30 Jul 2018 10:53:55 +0200 (CEST) Date: Mon, 30 Jul 2018 10:53:54 +0200 From: Peter Zijlstra To: Eduardo Valentin Cc: "Rafael J . Wysocki" , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Dou Liyang , Len Brown , "Rafael J. Wysocki" , "mike.travis@hpe.com" , Rajvi Jingar , Pavel Tatashin , Philippe Ombredanne , Kate Stewart , Greg Kroah-Hartman , x86@kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [PATCH RESEND 1/1] x86: tsc: avoid system instability in hibernation Message-ID: <20180730085354.GA2494@hirez.programming.kicks-ass.net> References: <20180726155656.14873-1-eduval@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180726155656.14873-1-eduval@amazon.com> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 26, 2018 at 08:56:56AM -0700, Eduardo Valentin wrote: > System instability are seen during resume from hibernation when system > is under heavy CPU load. This is due to the lack of update of sched > clock data Which would suggest you're already running with unstable sched clock. Otherwise nobody would care about the scd stuff. What kind of machine are you running? What does: dmesg | grep -i tsc say? > The fix for this situation is to mark the sched clock as unstable > as early as possible in the resume path, leaving it unstable > for the duration of the resume process. This will force the > scheduler to attempt to align the sched clock across CPUs using > the delta with time of day, updating sched clock data. In a post > hibernation event, we can then mark the sched clock as stable > again, avoiding unnecessary syncs with time of day on systems > in which TSC is reliable. None of this makes any sense. Either you were already unstable and it should already have worked and them marking it stable is an outright bug, or your sched clock was stable but then your initial diagnosis of lack of scd updates is complete garbage.