Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5740985pxu; Thu, 22 Oct 2020 09:52:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDgCORMHc3dD0vL5L9YcsfTzJRJFhmyx9hu/luKyl0kjhKMAdSEF5jl3dkCY3jP6AmP35o X-Received: by 2002:a17:906:b291:: with SMTP id q17mr3087595ejz.455.1603385522743; Thu, 22 Oct 2020 09:52:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603385522; cv=none; d=google.com; s=arc-20160816; b=08hqHdOH74TO3AaOYKDHRNiMaQkn3ehK0zJIuhAjJfkQL+MjZ3ijma4+aOg1IrN8Co PIiReSLrskkrm0YYaR/ezbX/1uDyzufHA4KQhyRnClx6aJJac7CDy06VPL+ES/U4UHVc WX7vA2rbQklCtQXxW6tHG+x0VPYFdCOdlFxr6LCUu1wlryZhUHRY1PK/v8gszMYvT2jq 87Tu+Z9JTcalsXtI1FRcrwwikVrMQKt7JcM34xO0Pp/10lSM/Oc2F1ltMz0yIUp1QENE dZwFtw0URVV3SY7VJMD/RLSxKunZ8ixyo8vMaVG8uKkHDYI4V/RxM3rwF15GoVy4sBlX VyBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/zZlgQ49hzZ8Igx9Ir7W2mtc3LsLICFZToYlcVG4c3s=; b=yIwvpmrRvPrL3tbwsT4S7pvqxh1t6ezi4u0JNYTkr1OHnPBaNmkMVDtU936KU6bb04 D4Y5qsNcf69d8UoR4e6h1ZWFKBPtouz5Fc7iAYiqkzXGHwflnFKxUwJcAsx/pGlArM8g XJHEfrM6B5zXK0r3IZ4wRdefH07aItwQ/ojucYrKFbiizNtZW4oqJDr/G9+rhHLL9iJh z3oL11BUYI987vwxpB5pPdjkr/qvK/lPi+Yh5B4cbR+7hDOt2rd+IoQxgbMWUW25k9b1 yuaNY7e789zk8+jP79JQvLEE8Lt+EKM8c/2V1IKE1NziKmafkEacntajokGdmvxfpWcs fweQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=OikXOIKq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v13si1819090edl.552.2020.10.22.09.51.40; Thu, 22 Oct 2020 09:52:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=OikXOIKq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2898252AbgJVMaw (ORCPT + 99 others); Thu, 22 Oct 2020 08:30:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2898170AbgJVMaw (ORCPT ); Thu, 22 Oct 2020 08:30:52 -0400 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 761E5C0613CE; Thu, 22 Oct 2020 05:30:52 -0700 (PDT) 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; bh=/zZlgQ49hzZ8Igx9Ir7W2mtc3LsLICFZToYlcVG4c3s=; b=OikXOIKqeP/evXisZbUfxoO7ss 9Dav6ZcY9P8OqgqxY4sLrkbOHmB9l3SZD3uv1jCLDEDErpBzAC5erMGuI+5O0DGezfBKibLDX3ru+ m8VvOusREx8QQzArsXRNJ3ox/CcGoxXaqFhKiARe8m27ooSpjxs4ybMW7RwChbdJo4ftX3QyWjfhc lN4JR485EjemVRi/YmIN3+O8ws3InRcIK5PL5fxHpLPMPEXoMuMSJ5Fc2cAb2ad5BQHa+4duz47/I BtsLZfGkXj6t9xJMTcaQPUJrT9OfAizMm8cwq+v366BoP9CDSQfroB28nCXVwEC+nW7MxzRw1MzGy w2AaiC8w==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kVZjx-0004Dy-TM; Thu, 22 Oct 2020 12:30:46 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 7A662304D28; Thu, 22 Oct 2020 14:30:44 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 700A32B90AF8C; Thu, 22 Oct 2020 14:30:44 +0200 (CEST) Date: Thu, 22 Oct 2020 14:30:44 +0200 From: Peter Zijlstra To: Giovanni Gherdovich Cc: Srinivas Pandruvada , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "Rafael J . Wysocki" , x86@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Ricardo Neri Subject: Re: [PATCH v2 1/3] x86, sched: check for counters overflow in frequency invariant accounting Message-ID: <20201022123044.GX2628@hirez.programming.kicks-ass.net> References: <20200531182453.15254-1-ggherdovich@suse.cz> <20200531182453.15254-2-ggherdovich@suse.cz> <20201022084618.GU2628@hirez.programming.kicks-ass.net> <1603369318.3162.21.camel@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1603369318.3162.21.camel@suse.cz> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 22, 2020 at 02:21:58PM +0200, Giovanni Gherdovich wrote: > On Thu, 2020-10-22 at 10:46 +0200, Peter Zijlstra wrote: > > On Sun, May 31, 2020 at 08:24:51PM +0200, Giovanni Gherdovich wrote: > > > > Hi Giovanni! > > > > > +error: > > > + pr_warn("Scheduler frequency invariance went wobbly, disabling!\n"); > > > + schedule_work(&disable_freq_invariance_work); > > > +} > > > > I'm getting reports that we trigger this on resume. Would it make sense > > to hook into tsc_{save,restore}_sched_clock_state() (or somewhere near > > there) to reset the state (basically call init_counter_refs() again to > > ensure we're not having to deal with crazy ? > > Hello, > > right, if the counters keep running while the machine is suspended then the > current code thinks it's a runtime overflow. I'll prepare a patch to fix that, > thanks for the heads-up and the hint. Either keep running, get reset, get scrambled, everything is possible. Thanks!