Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp2765112rwe; Sun, 28 Aug 2022 22:29:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR5tzVmmFStSVOJHh8og69bKaQ3g19ODq0EmBV+WmU50ysh0XvW3u7g6KiCeEMVrfIdgc/oo X-Received: by 2002:a17:90a:b781:b0:1fb:2f6b:12ed with SMTP id m1-20020a17090ab78100b001fb2f6b12edmr16250419pjr.204.1661750942136; Sun, 28 Aug 2022 22:29:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661750942; cv=none; d=google.com; s=arc-20160816; b=RgOZNB4khGvPtew8u45Wju/R/KUXovUiTOkl7RwXN3YwaM1GI1Ov8b1ljgIbxtUxnk c3cnehXorJLTDIKLEKvzLENoCRbDltdGqpjWEjT8LzS5rFseVNEdWTn76UIxqakzmW7n JvzEbVgSuid86tlBKGUPhrjt1FG0PJlFnxjuxG/IpLEKyuPRB9IUWU1Tz+ZapD/JlWwb +OAkUDqGXJvmqRinGoeNJZwKfW5ImyUmcsecbGr9U0T8TlT/ve2MLK+nq02BpoHf0JRt YYUTjj5c65SF6fRSFBpeMosBdFmCBPYBXjvqr8OAQHY8el1GG09/kBv9KbdPz0PTi5oy g6ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=wsQsJmlx/b9Usqt3EOZbAzQfYDAmz1MBCldoUQcDemQ=; b=mZJ40UUv+nyb36+p5evu+kGivDkRBOiNzAfusG+wFBy+NCRyW7p1hNjGmoJV6Fxcbj bZSZwS6fxA+QgYsuG3clEatvUJs3/GGZu5KHJq//21DWkQPQbja/dLwK8/gFW/tFoCqO z8XsKocgjaWgy2+SUazjkX1heqoVrw7fDLkAmmUVMdDYhYckifqySQ2PEWiMXKqrjUJg /CoJcs9P3INcqWkPZFtrOHetez7oa5U7jP1emm5JiTwFhAh/kKN4phjUZL5B2GFKFO6/ OBaZlZqfEsLrFhkntMIhyICceP4qqh0haJAOP7bScGJDV7Eygx3VWZN6hwTtgrGYInyO 6jqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x127-20020a628685000000b005369cdc34basi8507000pfd.119.2022.08.28.22.28.50; Sun, 28 Aug 2022 22:29:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229570AbiH2FNR (ORCPT + 99 others); Mon, 29 Aug 2022 01:13:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbiH2FNP (ORCPT ); Mon, 29 Aug 2022 01:13:15 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6FA3A422F5 for ; Sun, 28 Aug 2022 22:13:14 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0522D23A; Sun, 28 Aug 2022 22:13:20 -0700 (PDT) Received: from [192.168.178.6] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1B8033F766; Sun, 28 Aug 2022 22:13:39 -0700 (PDT) Message-ID: <42b2c57d-33d4-dc41-efc4-682aa02f9429@arm.com> Date: Mon, 29 Aug 2022 07:13:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH 1/2] sched/fair: Check if prev_cpu has highest spare cap in feec() Content-Language: en-US To: Pierre Gondois , linux-kernel@vger.kernel.org Cc: qperret@google.com, Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider References: <20220819153320.291720-1-pierre.gondois@arm.com> <20220819153320.291720-2-pierre.gondois@arm.com> From: Dietmar Eggemann In-Reply-To: <20220819153320.291720-2-pierre.gondois@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/08/2022 17:33, Pierre Gondois wrote: > When evaluating the CPU candidates in the perf domain (pd) containing > the previously used CPU (prev_cpu), find_energy_efficient_cpu() > evaluates the energy of the pd: > - without the task (base_energy) > - with the task placed on prev_cpu (if the task fits) > - with the task placed on the CPU with the highest spare capacity, > prev_cpu being excluded from this set > > If prev_cpu is already the CPU with the highest spare capacity, > max_spare_cap_cpu will be the CPU with the second highest spare > capacity. > > On an Arm64 Juno-r2, with a workload of 10 tasks at a 10% duty cycle, > when prev_cpu and max_spare_cap_cpu are both valid candidates, > prev_spare_cap > max_spare_cap at ~82%. > Thus the energy of the pd when placing the task on max_spare_cap_cpu > is computed with no possible positive outcome 82% most of the time. > > Do not consider max_spare_cap_cpu as a valid candidate if > prev_spare_cap > max_spare_cap. > > Signed-off-by: Pierre Gondois LGTM. When I ran the workload I see this happening in 50%-90% of the EAS wakeups. This should prevent one needless compute_energy() call out of 7 on a typical 3-gear system like 2x2x4 in these cases. Reviewed-by: Dietmar Eggemann [...]