Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp560190ybv; Thu, 13 Feb 2020 05:41:14 -0800 (PST) X-Google-Smtp-Source: APXvYqy2u2/KiSKirSUOHfs5BRHdiK+9me6EOPfqH8PKPX11dbaN0x3MneSawyLk77DPxVkMjfvT X-Received: by 2002:aca:aa0a:: with SMTP id t10mr2826994oie.156.1581601274510; Thu, 13 Feb 2020 05:41:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581601274; cv=none; d=google.com; s=arc-20160816; b=bLOEe9yoUbLHHSxDSHYL37yC+vGQMerX1YArLZnLMKcPtJ2OvUxmqbYXhA0YUXpPs2 6Ohnq7O3vzXPeoViKxCl8u+qRXyjBaMHDg+brqHBgIGg7gu4TQy3woGBy4i7gbRC3zJD rVCj7dQkcgcUXifX1zWtGyExWctbnbMC6E/0dNAk6toxOTo9NbAzfqBJqttaTMJtka0w YDfeSxodFkG1RjldeTM8gQ1twPg7kCdOdvTApLE1ouiTa3zWBnhmh7gmPgSQFDsJiIdL 37t1f3EyHAJWGarVc5HMzaQ14tCf5OW5zmQUrAiStRNgJT7SlhS9YS85oFnAxTRWIpkX s2AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=dx8L+v0H0N23P1dqw/3kUTw/aoE8MBLl4O9EVbJhhQk=; b=iS2fkDSgmUPkGidwhJY4r0FmQpPC9F9wcuzVR3P4m71y1oawTv2X/+VVnC3dfWHv6c UAfAOBLxQu9JdqY0Rj9IYHyMBDMQ0MbiCcRgRpTT9mOI1OZef0DnxxpYExULsG7+/a1a 8MixMRg10jo3TlQK2HvGcilWm+5jJ59vXPDBu/RQuhQ4NOx5nOpDWI7ael5se/+/QU+0 nN7eDwbus0uRiB7cYtL5g4XFnoV9ol00nzUGIXat/ToU0JQJeTgBpdjAQg3oxQWzqjQB ZXe19UVkgYaIZesrtiH1+eOOKqvOI/chubNa8DgpRH1HP4tNU39+daaiO51XCNLFEeDa fo8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fVOuTKuW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m19si1109566otq.40.2020.02.13.05.41.01; Thu, 13 Feb 2020 05:41:14 -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; dkim=pass header.i=@linaro.org header.s=google header.b=fVOuTKuW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730025AbgBMNjz (ORCPT + 99 others); Thu, 13 Feb 2020 08:39:55 -0500 Received: from mail-vk1-f196.google.com ([209.85.221.196]:45517 "EHLO mail-vk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729971AbgBMNjy (ORCPT ); Thu, 13 Feb 2020 08:39:54 -0500 Received: by mail-vk1-f196.google.com with SMTP id g7so1560788vkl.12 for ; Thu, 13 Feb 2020 05:39:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dx8L+v0H0N23P1dqw/3kUTw/aoE8MBLl4O9EVbJhhQk=; b=fVOuTKuWhfbmMx0CFhAt5lBFlFD4R4hw/cAT8WzR4yif0oxxKZRtN7He4HsMrIpR0b R9+1ksOOCfhvk5TUUvjd41iv02vYhQwp9FzUCTyk+DN8aE1p2uSQmKSkYngJXVcTtWWb LMtUoHf3yx2bRJn8jzj3JfyJjndtH3qLKF3AjmpwWJEfJ7sJMIubPH2h4P/ZzuYVx5X6 s8Jh3OTojunwLAQ7pEWes1d/kitgsF4KbYk7tj4squwEKp62DPDNl+/jGfwz9ASlPrPO QFOIAXiPB1omLzYPOXRK3GxIHzyAsxD3VAOHiM2HiodWIWO4NZIRiDzM1O/GuwT3Q7uR 6rPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dx8L+v0H0N23P1dqw/3kUTw/aoE8MBLl4O9EVbJhhQk=; b=Ce2Blg4HP86FFlq2LvYb/nZqYQ7BMhG5j+n1AtGoOsZN0b7OxfrKgbDHlkSZukRK5v KZfRQAr4YQnvMs5GxkMJBA2Ezf4oZQuWv3ZluBiZExlDHVO6Hhu0WV2F468+Eb1jL0ch 7M6nqQwtFHQp2P8xZwB1H9CjzFEiX9c1eNUz1XjbijJpIj7oCohHHAP4QVL0b7w05BA1 foURgDtSfNs5wePJ2DgDy5WHWiFvI2KrZjzZXGawuk8FbNf1yi5cZ2HVN/uZr+bRQezl h749ukBBSbIUe1efKwxCvfB4B+GVekJG/TCiOAG5Yg//vgvLeJZ8XpVz3wzmd02OFhCP P+TQ== X-Gm-Message-State: APjAAAXY8hQ9CH/cxwb3mRnaEdRn+n+SaldHm5x9uvMoVPeRwmYP4am0 3gCEu7pMQrSK4A//yK7yyOcGFjqxvxqe0+IAlPxnsw== X-Received: by 2002:a1f:7288:: with SMTP id n130mr1992940vkc.46.1581601193410; Thu, 13 Feb 2020 05:39:53 -0800 (PST) MIME-Version: 1.0 References: <1580250967-4386-1-git-send-email-thara.gopinath@linaro.org> <1580250967-4386-6-git-send-email-thara.gopinath@linaro.org> In-Reply-To: <1580250967-4386-6-git-send-email-thara.gopinath@linaro.org> From: Amit Kucheria Date: Thu, 13 Feb 2020 19:09:42 +0530 Message-ID: Subject: Re: [Patch v9 5/8] sched/fair: update cpu_capacity to reflect thermal pressure To: Thara Gopinath Cc: Ingo Molnar , Peter Zijlstra , ionela.voinescu@arm.com, Vincent Guittot , Dietmar Eggemann , Zhang Rui , qperret@google.com, Daniel Lezcano , Viresh Kumar , Steven Rostedt , Will Deacon , Catalin Marinas , Sudeep Holla , Juri Lelli , corbet@lwn.net, LKML , Amit Daniel Kachhap , Javi Merino Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 29, 2020 at 4:06 AM Thara Gopinath wrote: > > cpu_capacity initially reflects the maximum possible capacity of a cpu. > Thermal pressure on a cpu means this maximum possible capacity is > unavailable due to thermal events. This patch subtracts the average thermal > pressure for a cpu from its maximum possible capacity so that cpu_capacity > reflects the actual maximum currently available capacity. "actual maximum currently available capacity" is quite a mouthful. :-) "Remaining capacity" or "Effective capacity" anyone? IIUC, this remaining capacity is NOT the same as the capped/decreased capacity referred to in patches 1 and 3. The delta capacity (aka thermal pressure) there refers to the difference between HW max capacity and thermally throttled capacity. Here, we also subtract RT/DL utilisation. Is that accurate? > > Signed-off-by: Thara Gopinath > --- > > v8->v9: > - Use thermal_load_avg to read rq->avg_thermal.load_avg. > > kernel/sched/fair.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 5f58c03..d879077 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -7753,8 +7753,15 @@ static unsigned long scale_rt_capacity(struct sched_domain *sd, int cpu) > if (unlikely(irq >= max)) > return 1; > > + /* > + * avg_rt.util avg and avg_dl.util track binary signals > + * (running and not running) with weights 0 and 1024 respectively. > + * avg_thermal.load_avg tracks thermal pressure and the weighted > + * average uses the actual delta max capacity(load). > + */ > used = READ_ONCE(rq->avg_rt.util_avg); > used += READ_ONCE(rq->avg_dl.util_avg); > + used += thermal_load_avg(rq); > > if (unlikely(used >= max)) > return 1; > -- > 2.1.4 >