Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp27379pxu; Thu, 22 Oct 2020 14:23:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMpcKLeYzE8f/vSHdGZ+ERitX8X4jdKzxfT102s3MkWcD19xIR5COMjkepKpOVIAKs0DUJ X-Received: by 2002:a17:906:3146:: with SMTP id e6mr4005201eje.363.1603401785101; Thu, 22 Oct 2020 14:23:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603401785; cv=none; d=google.com; s=arc-20160816; b=LN6XUxHJDO64dJsU8g7Y/DFjxC1sScZH67h/2jKRrJ+WS+iVlEdLiL8Sj/7h4p3du/ HpeGG2xFc4ijUQzD7KYYE2/F0tHImaSyBloB7Bvc/4rFuGAmMyBVocWyFc1Brv6TImZ0 lPdPqDEWJt4CGafRmxSqzJhP9GPitSdhxug4vSBFGtcRn73GXdK+QY3D4SFzOlAmScMG ZWlU2OdUAx87jE9oh2GoCDxeu3cornt28KiOKthzgQyUtqsCkkmBXKUaOjC2Eho90yow bEYfb/kEE4h0rnO+4DqKLNzGIOU0hcuxqUUa12sekU0E2WyoGEAiUUHtiWiq5B+++Wx/ QlbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=btgM7XpiLbHiSi15JPEfm+qhHNv2y8WzrKUGrd8BXhU=; b=i1tLik5+zLSeaC89GmA9u0EeuArIWqzmq9f0a08ggi7mYe1KHJi3ONF2HnJ5V3i5n7 dBxNAkbOeQvJmEtRnfC6yZJ6O9fhH9L+w/WIrwxkstbw8i0+3/j+vK3R1Z/dTRKqa0Sn oCRWJhRKjFo3WI7wgXjYn/yy0X1fSQwZfEyZtpM7Q0zat1qbYLA+sROgReoFLQZtpQP6 1MY37cvgdv/M7DoDqhkr1kqp6l+5kUl1bVKaAdqzGihxcnZnvwSveqmNiWXEpmci7Lqd h2FsGu6JOCJ3Ttlj1DZyl4hbhjGNJWmTSdo3OjyzLzMJVo9VjnxAHKsfgOo5Zzrkl0xM yqUg== ARC-Authentication-Results: i=1; mx.google.com; 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 ar16si1776465ejc.405.2020.10.22.14.22.41; Thu, 22 Oct 2020 14:23:05 -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; 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 S2898031AbgJVMWB (ORCPT + 99 others); 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