Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp4872082rwb; Wed, 17 Aug 2022 07:24:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR5Xv3baZ0BAUCxu7m0v1K8TYLSaSeHiDD4Ppwk+uUHmHparDhw+euCAbmydw+p623WB8dBF X-Received: by 2002:a05:6a00:1d0f:b0:52f:d42c:8c60 with SMTP id a15-20020a056a001d0f00b0052fd42c8c60mr26142171pfx.82.1660746296356; Wed, 17 Aug 2022 07:24:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660746296; cv=none; d=google.com; s=arc-20160816; b=MjY2eQemwHqDdsvpfiiuLZq1vj83Q8ZZ3qt7GDC17NQ054Pg5zD8BI9L30aTcn/HLW do0/xNMQdfZmV/zlOiMlrhd4LEbMq4um5W92VvZ5MnvKvN6ftjfaK39r9kwEut7pfCmH Ri8ZL3fH82ycWk8MsWK1VZrYCnfFKic1ul4RAtRfMDoIB/eaDPuO9Yae5On0Gv5+4ZJo QPYsVfZ5IW6k20ziOh3QpHpKyOcdRAGEgUBBiNTiddmqTu9ToOS6AMFOxmfvFcSc0S80 JyAJuflzlhZQFhYL4BGMRfaS7zGlm+IjA56FGvrznAYAO3kfuCzK4cte1fgIht0ZVoB4 f/sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=sZb2G4JJcga2vNsc+NtgDyOn/TTecmblT/nkn1eqXQw=; b=BYlNnlbdSgGrkldr+hTtyDtQeNjUekh95Ji+6CqMa4vvyhXUOCz9BJRMSGIe/atiaC 6bhHccsvDiv8d5AsxLh3DHgKrmvkgySzg0tduUIGnz62pTGnnjHxKZ8mQDvUj+VdSaxz /Pipu45mzHWjjIHkYmMRkCOEhyHpI53qh/ixoR2OB5+IO4RFRSRvKPOQ5nzB6ON0oCul o132+MxsalSn2OWxEE1xtaZNOGMWf6lPvGXhy5pUnHfpeRt/MzAe2SuBq9VpqX628XQA 2mC+kto6l9Rh7B7SIn7BKPcbSB6538VTnIM010AA0AEMovHeO/hc+evxeGoEiImTOB8/ KcDA== 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 t12-20020a056a0021cc00b0052b8a12a070si11966845pfj.200.2022.08.17.07.24.44; Wed, 17 Aug 2022 07:24:56 -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 S239717AbiHQOVQ (ORCPT + 99 others); Wed, 17 Aug 2022 10:21:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234451AbiHQOVN (ORCPT ); Wed, 17 Aug 2022 10:21:13 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 546888D3F8; Wed, 17 Aug 2022 07:21:12 -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 B931E113E; Wed, 17 Aug 2022 07:21:12 -0700 (PDT) Received: from localhost (ionvoi01-desktop.cambridge.arm.com [10.1.196.65]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 829673F70D; Wed, 17 Aug 2022 07:21:11 -0700 (PDT) Date: Wed, 17 Aug 2022 15:21:09 +0100 From: Ionela Voinescu To: Pierre Gondois Cc: linux-kernel@vger.kernel.org, Lukasz.Luba@arm.com, Jonathan Corbet , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , linux-doc@vger.kernel.org Subject: Re: [PATCH] sched/topology: Remove EM_MAX_COMPLEXITY limit Message-ID: References: <20220812101620.627838-1-pierre.gondois@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220812101620.627838-1-pierre.gondois@arm.com> X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,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 Hi Pierre, On Friday 12 Aug 2022 at 12:16:19 (+0200), Pierre Gondois wrote: > From: Pierre Gondois > > The Energy Aware Scheduler (EAS) estimates the energy consumption > of placing a task on different CPUs. The goal is to minimize this > energy consumption. Estimating the energy of different task placements > is increasingly complex with the size of the platform. To avoid having > a slow wake-up path, EAS is only enabled if this complexity is low > enough. > > The current complexity limit was set in: > commit b68a4c0dba3b1 ("sched/topology: Disable EAS on inappropriate > platforms"). > base on the first implementation of EAS, which was re-computing > the power of the whole platform for each task placement scenario, cf: > commit 390031e4c309 ("sched/fair: Introduce an energy estimation helper > function"). > but the complexity of EAS was reduced in: > commit eb92692b2544d ("sched/fair: Speed-up energy-aware wake-ups") > and find_energy_efficient_cpu() (feec) algorithm was updated in: > commit 3e8c6c9aac42 ("sched/fair: Remove task_util from effective > utilization in feec()") > > find_energy_efficient_cpu() (feec) is now doing: > feec() > \_ for_each_pd(pd) [0] > // get max_spare_cap_cpu and compute_prev_delta > \_ for_each_cpu(pd) [1] > > \_ get_pd_busy_time(pd) [2] > \_ for_each_cpu(pd) > > // evaluate pd energy without the task > \_ get_pd_max_util(pd, -1) [3.0] > \_ for_each_cpu(pd) > \_ compute_energy(pd, -1) > \_ for_each_ps(pd) > > // evaluate pd energy with the task on prev_cpu > \_ get_pd_max_util(pd, prev_cpu) [3.1] > \_ for_each_cpu(pd) > \_ compute_energy(pd, prev_cpu) > \_ for_each_ps(pd) > > // evaluate pd energy with the task on max_spare_cap_cpu > \_ get_pd_max_util(pd, max_spare_cap_cpu) [3.2] > \_ for_each_cpu(pd) > \_ compute_energy(pd, max_spare_cap_cpu) > \_ for_each_ps(pd) > > [3.1] happens only once since prev_cpu is unique. To have an upper > bound of the complexity, [3.1] is taken into account for all pds. > So with the same definitions for nr_pd, nr_cpus and nr_ps, > the complexity is of: > nr_pd * (2 * [nr_cpus in pd] + 3 * ([nr_cpus in pd] + [nr_ps in pd])) > [0] * ( [1] + [2] + [3.0] + [3.1] + [3.2] ) > = 5 * nr_cpus + 3 * nr_ps > I just want to draw your attention to [1] and the fact that the structure of the function changed. Your calculations largely remain the same - 3 calls to compute_energy() which in turn now calls eenv_pd_max_util() with operations for each cpu, plus some scattered calls to eenv_pd_busy_time(), all for each pd. [1] https://lore.kernel.org/lkml/20220621090414.433602-7-vdonnefort@google.com/ Thanks, Ionela.