Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp826217ybx; Wed, 6 Nov 2019 09:00:16 -0800 (PST) X-Google-Smtp-Source: APXvYqwyh/EtOPs9HKdQ7n24geD8Qd5aT+r7lNUAC2Eam1BE2h+GYa7IWwh1RihLryVXsFeLvJ3d X-Received: by 2002:a50:ac2c:: with SMTP id v41mr3788618edc.11.1573059616747; Wed, 06 Nov 2019 09:00:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573059616; cv=none; d=google.com; s=arc-20160816; b=D9sEDhiYkmyCV8+dNTfC5l5A1lOqcFaEyWqr6G8/34/+S0j6irPYyhcJKBP154mJ+1 W1dz/w5y7NKM8sGBhWKAdocJsNjyMS8Fu/qPnbO2/ANTyE6qCR8meohvsQzIZgifMEAa 5wcKfWdOtC/MANVIrH3YU1cumdM1y/14x8wlOoirg0VrjiMp3muQ+rLPYqucQ5/NrrTU rHnHfEZjMUHSpe3FnWZBKEh7FiFoUh9kom8bpzZar6WPYvzCmC7cPWfn482kVsxZ/2oO wt7iuxNv0e+Wg+OlnlXU2K1p3oQ9Lu5ar8g98G/tHMUwieszGjBHO3reLPy/p2Lx+86Y MqQg== 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=mt4AD5WRhOdkTuos6nfnBKkpbdfv0qNyT9EHTkMHsEs=; b=NePDnkUE1ySHvEbr53z+dt+4FVkPAxBcZJPocCJi5jDd7bIW2+4pDlFMqOggwfd2na ogRHsltlJ11CIoTXC8IxflwSKAjtWBzev/2K/X7nbuyVqwzakbUSq/HSO1ODttwN6Y5m HI1yRcFyD3rijTj632feGdViDgOrQvqmESnf5HxIO0QXb/JOQkqfDS9y/W9IJFmy5gy+ OYYadUquh65B8fyYdNID2AShrN8gBl1mhx7Sz6xxwwd7OtY+3TdhlyR0axvb9l7csOeP FiM22B4M82iys/ZaFZQqq3R5Ns0PAB6wg2Bht8yyzha+zaWWDg9/zm+Tuc9ZQQcol1P0 iXaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d6si14421449ede.119.2019.11.06.08.59.53; Wed, 06 Nov 2019 09:00:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732315AbfKFQ4x (ORCPT + 99 others); Wed, 6 Nov 2019 11:56:53 -0500 Received: from foss.arm.com ([217.140.110.172]:43158 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732201AbfKFQ4w (ORCPT ); Wed, 6 Nov 2019 11:56:52 -0500 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 375C746A; Wed, 6 Nov 2019 08:56:52 -0800 (PST) Received: from e107158-lin.cambridge.arm.com (e107158-lin.cambridge.arm.com [10.1.195.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9CC9B3F719; Wed, 6 Nov 2019 08:56:50 -0800 (PST) Date: Wed, 6 Nov 2019 16:56:48 +0000 From: Qais Yousef To: Thara Gopinath Cc: mingo@redhat.com, peterz@infradead.org, ionela.voinescu@arm.com, vincent.guittot@linaro.org, rui.zhang@intel.com, edubezval@gmail.com, qperret@google.com, linux-kernel@vger.kernel.org, amit.kachhap@gmail.com, javi.merino@kernel.org, daniel.lezcano@linaro.org Subject: Re: [Patch v5 4/6] sched/fair: update cpu_capcity to reflect thermal pressure Message-ID: <20191106165646.vc7j4hbhj2hcrku4@e107158-lin.cambridge.arm.com> References: <1572979786-20361-1-git-send-email-thara.gopinath@linaro.org> <1572979786-20361-5-git-send-email-thara.gopinath@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1572979786-20361-5-git-send-email-thara.gopinath@linaro.org> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/05/19 13:49, Thara Gopinath wrote: > cpu_capacity relflects the maximum available capacity of a cpu. Thermal > pressure on a cpu means this maximum available capacity is reduced. This > patch reduces the average thermal pressure for a cpu from its maximum > available capacity so that cpu_capacity reflects the actual > available capacity. > > Other signals that are deducted from cpu_capacity to reflect the actual > capacity available are rt and dl util_avg. util_avg tracks a binary signal > and uses the weights 1024 and 0. Whereas thermal pressure is tracked > using load_avg. load_avg uses the actual "delta" capacity as the weight. I think you intended to put this as comment... > > Signed-off-by: Thara Gopinath > --- > kernel/sched/fair.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 9fb0494..5f6c371 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -7738,6 +7738,7 @@ static unsigned long scale_rt_capacity(struct sched_domain *sd, int cpu) > > used = READ_ONCE(rq->avg_rt.util_avg); > used += READ_ONCE(rq->avg_dl.util_avg); > + used += READ_ONCE(rq->avg_thermal.load_avg); ... here? I find the explanation hard to parse too. Do you think you can rephrase it? Something based on what you wrote here would be more understandable IMHO: https://lore.kernel.org/lkml/5DBB05BC.40502@linaro.org/ Thanks! -- Qais Yousef > > if (unlikely(used >= max)) > return 1; > -- > 2.1.4 >