Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1860859ybg; Thu, 30 Jul 2020 04:45:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrp5CLBus1VT8DhEIqn42+6zSeBXsnoIA8qA2+fWtUbFGBVjrYuY8hZ1pFmPNbmnuHnA6V X-Received: by 2002:a17:906:a142:: with SMTP id bu2mr2275159ejb.277.1596109552017; Thu, 30 Jul 2020 04:45:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596109552; cv=none; d=google.com; s=arc-20160816; b=kXA6jXWNiMNXMc/isQEpmnbhcaiYt9fpmhC3cNgf4J0hffGw19nFQ9VZsUmvYarLKR mJtWAAs8jxvW6PRb88cIiZVITEeb00kSEAfpqgDRIMCIgzhF5tGVN0AE1q2sDjt96Pi2 D4Q5euAGle+Fjk22YnzmkJMMQi7VlsaS7PKy+hI3ory3KIr+uMsqHorRRzPaz3+6vGGZ Yg29+F27y08/k/2zpo8rJXNjPEPg/xsi0PJGySj17J3lbIjdUT/3oJADmrRnUVmWZrqD WLu3FzBHqRGhvxshlLJG1WYT8RVRmLNVi2bTSycpoNlRzq6mXe5NCyJsbG8Ymym+A5tN 2PVQ== 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; bh=3dmV2A+bfw6a5BprGQre0iOyCFE6nUzpoYhkyfdFlGU=; b=l/0qGcFjmOnqu4UESBdeO/PD6o/tNIlkH4VI8XQ7QsvgsX83ukjvHeFPSuyXP9Ydo2 iYn/uCnn8RV4eVMbi98AvV0N3j7jltn62N3CTZVt9ZNa0RPeKQNptKs1fnI7HZXcgvMI TUIlFGwn8M+8itBuJXYqJNZvDEms/zGQudu+Q7qV9lD6zc8tdpLfN4iW7b0FdLTB5cVs OYzaGfgu5vH33KjpetdlzHUiLeqlP/h6mdoqOHIDOj5mG6gBgj0JI1a3ndgQPo/Iwn6l Hc1co7crk/nozyxBkilX0QC7XC2aojthG05QuLTvAPR7NM5ztqlE45lOLLu8/DlxLOLK DbJw== 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 d9si3173059edo.522.2020.07.30.04.45.29; Thu, 30 Jul 2020 04:45:52 -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 S1727797AbgG3Lox (ORCPT + 99 others); Thu, 30 Jul 2020 07:44:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:51340 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726267AbgG3Lox (ORCPT ); Thu, 30 Jul 2020 07:44:53 -0400 Received: from gaia (unknown [95.146.230.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9FDAD2082E; Thu, 30 Jul 2020 11:44:50 +0000 (UTC) Date: Thu, 30 Jul 2020 12:44:48 +0100 From: Catalin Marinas To: Ionela Voinescu Cc: rjw@rjwysocki.net, viresh.kumar@linaro.org, dietmar.eggemann@arm.com, sudeep.holla@arm.com, will@kernel.org, linux@armlinux.org.uk, mingo@redhat.com, peterz@infradead.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Valentin Schneider Subject: Re: [PATCH v2 6/7] arch_topology,arm,arm64: define arch_scale_freq_invariant() Message-ID: <20200730114447.GK25149@gaia> References: <20200722093732.14297-1-ionela.voinescu@arm.com> <20200722093732.14297-7-ionela.voinescu@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200722093732.14297-7-ionela.voinescu@arm.com> 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, Jul 22, 2020 at 10:37:31AM +0100, Ionela Voinescu wrote: > From: Valentin Schneider > > arch_scale_freq_invariant() is used by schedutil to determine whether > the scheduler's load-tracking signals are frequency invariant. Its > definition is overridable, though by default it is hardcoded to 'true' > if arch_scale_freq_capacity() is defined ('false' otherwise). > > This behaviour is not overridden on arm, arm64 and other users of the > generic arch topology driver, which is somewhat precarious: > arch_scale_freq_capacity() will always be defined, yet not all cpufreq > drivers are guaranteed to drive the frequency invariance scale factor > setting. In other words, the load-tracking signals may very well *not* > be frequency invariant. > > Now that cpufreq can be queried on whether the current driver is driving > the Frequency Invariance (FI) scale setting, the current situation can > be improved. This combines the query of whether cpufreq supports the > setting of the frequency scale factor, with whether all online CPUs are > counter-based FI enabled. > > While cpufreq FI enablement applies at system level, for all CPUs, > counter-based FI support could also be used for only a subset of CPUs to > set the invariance scale factor. Therefore, if cpufreq-based FI support > is present, we consider the system to be invariant. If missing, we > require all online CPUs to be counter-based FI enabled in order for the > full system to be considered invariant. > > If the system ends up not being invariant, a new condition is needed in > the counter initialization code that disables all scale factor setting > based on counters. > > Precedence of counters over cpufreq use is not important here. The > invariant status is only given to the system if all CPUs have at least > one method of setting the frequency scale factor. > > Signed-off-by: Valentin Schneider > Signed-off-by: Ionela Voinescu > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Sudeep Holla Acked-by: Catalin Marinas