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=-6.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 4EB60C55ABD for ; Tue, 10 Nov 2020 17:20:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0566420781 for ; Tue, 10 Nov 2020 17:20:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730258AbgKJRU3 (ORCPT ); Tue, 10 Nov 2020 12:20:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:43600 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726179AbgKJRU2 (ORCPT ); Tue, 10 Nov 2020 12:20:28 -0500 Received: from trantor (unknown [2.26.170.190]) (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 89055206F1; Tue, 10 Nov 2020 17:20:25 +0000 (UTC) Date: Tue, 10 Nov 2020 17:20:23 +0000 From: Catalin Marinas To: Ionela Voinescu Cc: mingo@redhat.com, peterz@infradead.org, vincent.guittot@linaro.org, will@kernel.org, rjw@rjwysocki.net, viresh.kumar@linaro.org, dietmar.eggemann@arm.com, qperret@google.com, valentin.schneider@arm.com, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RESEND v2 2/3] arm64: rebuild sched domains on invariance status changes Message-ID: References: <20201027180713.7642-1-ionela.voinescu@arm.com> <20201027180713.7642-3-ionela.voinescu@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201027180713.7642-3-ionela.voinescu@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 27, 2020 at 06:07:12PM +0000, Ionela Voinescu wrote: > Task scheduler behavior depends on frequency invariance (FI) support and > the resulting invariant load tracking signals. For example, in order to > make accurate predictions across CPUs for all performance states, Energy > Aware Scheduling (EAS) needs frequency-invariant load tracking signals > and therefore it has a direct dependency on FI. This dependency is known, > but EAS enablement is not yet conditioned on the presence of FI during > the built of the scheduling domain hierarchy. > > Before this is done, the following must be considered: while > arch_scale_freq_invariant() will see changes in FI support and could > be used to condition the use of EAS, it could return different values > during system initialisation. > > For arm64, such a scenario will happen for a system that does not support > cpufreq driven FI, but does support counter-driven FI. For such a system, > arch_scale_freq_invariant() will return false if called before counter > based FI initialisation, but change its status to true after it. > If EAS becomes explicitly dependent on FI this would affect the task > scheduler behavior which builds its scheduling domain hierarchy well > before the late counter-based FI init. During that process, EAS would be > disabled due to its dependency on FI. > > Two points of future early calls to arch_scale_freq_invariant() which > would determine EAS enablement are: > - (1) drivers/base/arch_topology.c:126 <> > rebuild_sched_domains(); > This will happen after CPU capacity initialisation. > - (2) kernel/sched/cpufreq_schedutil.c:917 <> > rebuild_sched_domains_energy(); > -->rebuild_sched_domains(); > This will happen during sched_cpufreq_governor_change() for the > schedutil cpufreq governor. > > Therefore, before enforcing the presence of FI support for the use of EAS, > ensure the following: if there is a change in FI support status after > counter init, use the existing rebuild_sched_domains_energy() function to > trigger a rebuild of the scheduling and performance domains that in turn > will determine the enablement of EAS. > > Signed-off-by: Ionela Voinescu > Cc: Catalin Marinas > Cc: Will Deacon Acked-by: Catalin Marinas 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=-6.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 C1676C388F7 for ; Tue, 10 Nov 2020 17:20:56 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 57FD8206F1 for ; Tue, 10 Nov 2020 17:20:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="B/nPeKBK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 57FD8206F1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jK3atmSz7feJ4VtTMJFWayp6lfkz/q2Xg9QDKR2Hay0=; b=B/nPeKBKv56TJ/jRzuA7gP79H qtu+xdy54tMEAWWXAK/qWoQNZhSisgD9poDsFXi6nDCW3//wxbep2FBH/x4hBx9/WFFUCHLEfRIbh jt2Pib2ifG4gA8m8XtT5tgkw2E2uu2pNABV2Rjx9LxraAWG6oGPst3a89KaMlU9Up0wlhSDL2Y6Cn Tjhv9VxcnCvzjjiZfEGIxgEGYQiWdHh97SbqpNb79/d6JtKCAqWFipCEYBD5iEX0k7sEZBYQYen0+ vQrSHTxehs93kWtX102p8Ac2feejhDtCXrOsuYT+aLNJIYEV3+UygA53KF6V1YORnC7dGfUzO5VLQ Vp55lTM6Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcXJo-0002gq-8w; Tue, 10 Nov 2020 17:20:32 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcXJk-0002fR-Sz for linux-arm-kernel@lists.infradead.org; Tue, 10 Nov 2020 17:20:30 +0000 Received: from trantor (unknown [2.26.170.190]) (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 89055206F1; Tue, 10 Nov 2020 17:20:25 +0000 (UTC) Date: Tue, 10 Nov 2020 17:20:23 +0000 From: Catalin Marinas To: Ionela Voinescu Subject: Re: [PATCH RESEND v2 2/3] arm64: rebuild sched domains on invariance status changes Message-ID: References: <20201027180713.7642-1-ionela.voinescu@arm.com> <20201027180713.7642-3-ionela.voinescu@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201027180713.7642-3-ionela.voinescu@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201110_122029_064792_5181FEA6 X-CRM114-Status: GOOD ( 21.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: vincent.guittot@linaro.org, qperret@google.com, peterz@infradead.org, viresh.kumar@linaro.org, linux-pm@vger.kernel.org, rjw@rjwysocki.net, linux-kernel@vger.kernel.org, valentin.schneider@arm.com, mingo@redhat.com, will@kernel.org, dietmar.eggemann@arm.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Oct 27, 2020 at 06:07:12PM +0000, Ionela Voinescu wrote: > Task scheduler behavior depends on frequency invariance (FI) support and > the resulting invariant load tracking signals. For example, in order to > make accurate predictions across CPUs for all performance states, Energy > Aware Scheduling (EAS) needs frequency-invariant load tracking signals > and therefore it has a direct dependency on FI. This dependency is known, > but EAS enablement is not yet conditioned on the presence of FI during > the built of the scheduling domain hierarchy. > > Before this is done, the following must be considered: while > arch_scale_freq_invariant() will see changes in FI support and could > be used to condition the use of EAS, it could return different values > during system initialisation. > > For arm64, such a scenario will happen for a system that does not support > cpufreq driven FI, but does support counter-driven FI. For such a system, > arch_scale_freq_invariant() will return false if called before counter > based FI initialisation, but change its status to true after it. > If EAS becomes explicitly dependent on FI this would affect the task > scheduler behavior which builds its scheduling domain hierarchy well > before the late counter-based FI init. During that process, EAS would be > disabled due to its dependency on FI. > > Two points of future early calls to arch_scale_freq_invariant() which > would determine EAS enablement are: > - (1) drivers/base/arch_topology.c:126 <> > rebuild_sched_domains(); > This will happen after CPU capacity initialisation. > - (2) kernel/sched/cpufreq_schedutil.c:917 <> > rebuild_sched_domains_energy(); > -->rebuild_sched_domains(); > This will happen during sched_cpufreq_governor_change() for the > schedutil cpufreq governor. > > Therefore, before enforcing the presence of FI support for the use of EAS, > ensure the following: if there is a change in FI support status after > counter init, use the existing rebuild_sched_domains_energy() function to > trigger a rebuild of the scheduling and performance domains that in turn > will determine the enablement of EAS. > > Signed-off-by: Ionela Voinescu > Cc: Catalin Marinas > Cc: Will Deacon Acked-by: Catalin Marinas _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel