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=-2.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 DF99DECE58A for ; Wed, 2 Oct 2019 18:28:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B5F6B218DE for ; Wed, 2 Oct 2019 18:28:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="CCOLZ4SE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728925AbfJBS2T (ORCPT ); Wed, 2 Oct 2019 14:28:19 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:54112 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726076AbfJBS2S (ORCPT ); Wed, 2 Oct 2019 14:28:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=96la58gVKcd/IPrCDjANz2T8kDNFpSL3xM8lpSJtFpc=; b=CCOLZ4SE23QMLmce5D5G1Ec6b sM7VLGa+SfcWpro867kEc183BRJNvnqD4Dal4s7ZKfjkaL/TmTAR2HOONTkks3Npmfz8qVfDmmqfd /0q4P2NjX5W5feBpmQbkwpFLSGaKJp/6sKg68+74i/1VuB+LlMuJY1CfLMwhTvzr1Ai2j4O8joZjg Im+OuW19A6Iji79yUvmcDoeET/1EwIM+5HnYEFFPrEOUedrIOJYRaetluxZ6OZRgsB4LJwuz6mROp bsFjXSNK61Ejnd2bMDynY9xtdQb802h9WJ4ZZaWxVJDn5A6gXOQ2ua/xOgY1JZemuB/nJIXTMyZN2 WBPG0qD3Q==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.2 #3 (Red Hat Linux)) id 1iFjLx-0004hA-2I; Wed, 02 Oct 2019 18:27:57 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 0E9979802BF; Wed, 2 Oct 2019 20:27:55 +0200 (CEST) Date: Wed, 2 Oct 2019 20:27:55 +0200 From: Peter Zijlstra To: Giovanni Gherdovich Cc: Srinivas Pandruvada , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Len Brown , "Rafael J . Wysocki" , x86@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Mel Gorman , Matt Fleming , Viresh Kumar , Juri Lelli , Paul Turner , Vincent Guittot , Quentin Perret , Dietmar Eggemann , Doug Smythies Subject: Re: [PATCH v2 1/2] x86,sched: Add support for frequency invariance Message-ID: <20191002182754.GD4643@worktop.programming.kicks-ass.net> References: <20191002122926.385-1-ggherdovich@suse.cz> <20191002122926.385-2-ggherdovich@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191002122926.385-2-ggherdovich@suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 02, 2019 at 02:29:25PM +0200, Giovanni Gherdovich wrote: > +void x86_arch_scale_freq_tick_enable(void) > +{ > + tick_disable = false; > +} > + > +static void reset_scale_freq(void *arg) > +{ > + this_cpu_write(arch_cpu_freq, SCHED_CAPACITY_SCALE); > +} > + > +void x86_arch_scale_freq_tick_disable(void) > +{ > + on_each_cpu(reset_scale_freq, NULL, 1); > + tick_disable = true; I'm thikning this ought to be the other way around, otherwise we can get a tick loosing the 1024 we just wrote in arch_cpu_freq. > +} You've lost the prev_{a,m}perf update, so the first tick after enable will see 'funny' values.