Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp4681085ioo; Tue, 31 May 2022 09:16:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5wl3EjgFW3+BMhaROq4qxHTXqCniLzdyBcBrj+pryKlLJAxhynYn5kIc2/lSASYUVWVXS X-Received: by 2002:a17:902:f688:b0:163:ee37:91c5 with SMTP id l8-20020a170902f68800b00163ee3791c5mr8264076plg.86.1654013764348; Tue, 31 May 2022 09:16:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654013764; cv=none; d=google.com; s=arc-20160816; b=a96CKaf1LYjpRxY3a+X/iyjXaZBtNKt80J+VbekTclsKgWBkGEPeDVwmvuMVZXjbsv hcTuW81owqVJPXAvdcR3MfhXzhTJMI3uIRmnKVsCeHIc+fmMMs5DtH/jkSsXxzMm7gsM m0xWOsfpnbwnjZhXeLuO73593vFmq5tvTR7/JMlCBzEroF2lJ+YG13m2ks1DvcP/5Vto HKAmX7WLvcjF86oqLKnZIFTKRMOhXEK4Gj50pr4hzr5pY1/1GGTGIoOXVrgVwjFeIeUr Z90xN6lpzmBu4I1ktKg95dKWW6bLFWm8TEAG1u46P7nGGr/4ubmVSDgIySlFUK6vPOjT dNMA== 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 :content-language:references:cc:to:subject:from:user-agent :mime-version:date:message-id; bh=1jC5fibQ9uHmcingd7C8ZT+xgxREk7xZSOQu9gQUbwI=; b=Dz9MxhdZ4fyX44JiY2zjzsdkJkYf/CuYNSIkXaoE2EzjJJ0eNXfbhfYWKPkGLlXJRE NxJx5TOQMrrMwG4Msa7R6Hk5r5gqsW2VO6FVzXmkBl30jCm+fehP2KnabcHJVt1ziAFu 0gof+RHMg/k00dCtLsrv5f3ZlRuEIj9nJ2TQf+ef3E2qxQemUNE209ql+1WA79XJx0YY 1HJybPGCosD1tjyADv55PKC+Xh0Cutel5xftRKRLwiepYNWQ1KPCJ8ga8vXVIOk7pi9J A1e1WksitVbTTlTYwaqQVDIhIclYvzS5S9PfkStyoIxJFdgJoq+/CjLFnMuR56gknYSM 7tVw== 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 200-20020a6300d1000000b003fbda3956e2si12714369pga.763.2022.05.31.09.15.51; Tue, 31 May 2022 09:16:04 -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 S244762AbiEaIRR (ORCPT + 99 others); Tue, 31 May 2022 04:17:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240336AbiEaIRQ (ORCPT ); Tue, 31 May 2022 04:17:16 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 97FC412096 for ; Tue, 31 May 2022 01:17:15 -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 5C16323A; Tue, 31 May 2022 01:17:15 -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 38C7B3F73D; Tue, 31 May 2022 01:17:12 -0700 (PDT) Message-ID: Date: Tue, 31 May 2022 10:17:01 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 From: Dietmar Eggemann Subject: Re: [PATCH v9 6/7] sched/fair: Remove task_util from effective utilization in feec() To: Vincent Donnefort , peterz@infradead.org, mingo@redhat.com, vincent.guittot@linaro.org Cc: linux-kernel@vger.kernel.org, morten.rasmussen@arm.com, chris.redpath@arm.com, qperret@google.com, tao.zhou@linux.dev, kernel-team@android.com References: <20220523155140.2878563-1-vdonnefort@google.com> <20220523155140.2878563-7-vdonnefort@google.com> Content-Language: en-US In-Reply-To: <20220523155140.2878563-7-vdonnefort@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,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 - Vincent Donnefort On 23/05/2022 17:51, Vincent Donnefort wrote: > From: Vincent Donnefort [...] > @@ -6834,22 +6887,36 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu) > if (!task_util_est(p)) > goto unlock; > > + eenv_task_busy_time(&eenv, p, prev_cpu); > + > for (; pd; pd = pd->next) { > - unsigned long cur_delta, spare_cap, max_spare_cap = 0; > + unsigned long cpu_cap, cpu_thermal_cap, util; > + unsigned long cur_delta, max_spare_cap = 0; > bool compute_prev_delta = false; > unsigned long base_energy_pd; > int max_spare_cap_cpu = -1; > > cpumask_and(cpus, perf_domain_span(pd), cpu_online_mask); Internal EAS testing of this patch-set version has revealed that this doesn't work against LTP CPU hotplug stress test. `struct cpumask *cpus` can't be used when it is empty. This can happen in case all PD CPUs are hotplugged out since we `and` the invariant PD cpumask with cpu_online_mask. We need a: + if (cpumask_empty(cpus)) + continue; + here. > - for_each_cpu_and(cpu, cpus, sched_domain_span(sd)) { > + /* Account thermal pressure for the energy estimation */ > + cpu = cpumask_first(cpus); > + cpu_thermal_cap = arch_scale_cpu_capacity(cpu); > + cpu_thermal_cap -= arch_scale_thermal_pressure(cpu); [...]