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=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 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 38E91C388F7 for ; Thu, 22 Oct 2020 12:22:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D47E8223FB for ; Thu, 22 Oct 2020 12:22:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2898059AbgJVMWB (ORCPT ); Thu, 22 Oct 2020 08:22:01 -0400 Received: from mx2.suse.de ([195.135.220.15]:41022 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2503608AbgJVMWB (ORCPT ); Thu, 22 Oct 2020 08:22:01 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id C5429AEFE; Thu, 22 Oct 2020 12:21:59 +0000 (UTC) Message-ID: <1603369318.3162.21.camel@suse.cz> Subject: Re: [PATCH v2 1/3] x86, sched: check for counters overflow in frequency invariant accounting From: Giovanni Gherdovich To: Peter Zijlstra 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 Date: Thu, 22 Oct 2020 14:21:58 +0200 In-Reply-To: <20201022084618.GU2628@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> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Giovanni