Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1148013ybn; Wed, 2 Oct 2019 11:31:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwZJ9j2G9hXumVzqM36nQ5E+LAoKXFeVjxmo5GopEykCtXS0sCDPCIWHFYjHWSFCq9sRqT X-Received: by 2002:a50:9f42:: with SMTP id b60mr5489917edf.192.1570041118542; Wed, 02 Oct 2019 11:31:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570041118; cv=none; d=google.com; s=arc-20160816; b=P/867qU5La8qjQ0qcE+PMJMrdkrj70nFHi9HgHiDNTtu021EvwjnCNkQx7y90Miohd vbUVCI3gsKx2Bm07exDXOm8m1o8yfemGGLt5Tcz/Ls/Q1n3O2wfWhVkzyYcHh+lOHJB3 /xpBdNlitfeVvfsJjo7PkU3R0km9/Y8B1kEYEOjDBsPwTRASb8KmspMofwgNuOSqLzeS XPiSSIIQVTR2ONzu4Pvt43BtDpAhhEb/m7P4p6qxbaj9ej/rXn8E4gq6TxTtMvWHTSWW N94AVoujtLKuAQdjNvSS1ILVc94gdlyv2grSF0car8TKzwpqf6hMCbul/9k/mVphOFgI cz3A== 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; bh=96la58gVKcd/IPrCDjANz2T8kDNFpSL3xM8lpSJtFpc=; b=jAMSnFm1iqZxaLB7WzFHREsFbJfMqN2umPCZwVRmRJZnHM1bBXWziY16Ij9jWS/Ama 5K/Sq5ln15q4zNX3TY40nZI5km0bOr7BtcG6XZyDdMe/TsIYMyk6FqkDD90pCUc/z/cb NMB39rEYyjOCQbP8Flg55jc4UM69cKGvYZwHhK/Bi1qh3/okIPIOy3jFtv6JxYUt29xd kXjSzRjMxIcBjtu6HoZsvc3nGDsGCHB11wJ0LGrVtf3KglK4T7XZYPh0ggQfAs2L1xYn kfRcor6fHvRSsgIx4E4B5hdCFvvzro/cy35isjxMesVtqoEm5Ucmf62ToDbIxq8jvy5B 7lSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=CCOLZ4SE; 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 l21si11851963edc.112.2019.10.02.11.31.34; Wed, 02 Oct 2019 11:31:58 -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=bombadil.20170209 header.b=CCOLZ4SE; 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 S1728909AbfJBS2T (ORCPT + 99 others); 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.