Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp984238imm; Wed, 10 Oct 2018 07:24:46 -0700 (PDT) X-Google-Smtp-Source: ACcGV60ILUY3f7mMYNwcArgcnvJwAPlg2Rcdrlllo0bGR9Fy2c+9LZzsQsF1wBqNegKsPieLt1bT X-Received: by 2002:a62:da03:: with SMTP id c3-v6mr35804228pfh.52.1539181486124; Wed, 10 Oct 2018 07:24:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539181486; cv=none; d=google.com; s=arc-20160816; b=0BFvWK6fTaV+RDlkg2TKKAFcTOUuTYXg/EkOkUqo89NCy/dT/eFmaWadxklld4yQbe nQLecFQJ2j1qLisn46BWa23j2OUPNGHTYmq4OJesJeuqeZUxHhv+uVbN1+Xqxy9Swgyz +AsZBnt+TrBXY83uHNdtsaN74ak/OtKf/oiVE43+e8zHxnTgJGxH9BHsAUQJVxSWf98F mEuQrQh3OemJlj4M7plUlaXUi2sXUerPq/683poGRH8PhCifGW/z96Q2i/QlYLMTQB17 yz9GHZAelN61roX/c3fhBqcElrmeqd7w1HiNOBaaF93S5Gyjms85sPqTyWXVRpjSVEq7 ekgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:dkim-signature; bh=tAWmy0gMuXOcZJtdhH+ZjiZQiAbEcdaue2riVUXB+F4=; b=CejWr505sTBRsof6Thc/C80W/kCZgPMOwl3T6CBc37j3/XV3yDeefY0mc5FlCkEa1J bkIRDZ1MR5RM8SDWV2TRX5CQXA/1x/Keg+Zf9/rbFMcKTyBLspfGNOL9sDH1/ostLSsI aPD0I3dicmeA/Eu0ZLz3SbKRIj06wdkw+Ij4p/14Z/ZudQG2E6cOXalCYxGBg8jN47Nk IgsVN6lZBwNIKEExAg9AHiiXd69sZTb5EQ2V8W9mS6XOtaw20V77NW3wixI8bCLr3i6+ BCtwX7cmFM9/4syUX1l10UVMnMs2KRAxlyYX/3U1fSrhg5SVUfKO74vEaMHEUYPZyaBc Wy2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jJNKEPVR; 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 w20-v6si24776771pll.89.2018.10.10.07.24.30; Wed, 10 Oct 2018 07:24:46 -0700 (PDT) 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=jJNKEPVR; 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 S1727160AbeJJVor (ORCPT + 99 others); Wed, 10 Oct 2018 17:44:47 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:35495 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726666AbeJJVor (ORCPT ); Wed, 10 Oct 2018 17:44:47 -0400 Received: by mail-qk1-f194.google.com with SMTP id v68-v6so3250222qka.2 for ; Wed, 10 Oct 2018 07:22:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=tAWmy0gMuXOcZJtdhH+ZjiZQiAbEcdaue2riVUXB+F4=; b=jJNKEPVRgfBzcs2nBwrv2OUecLJcaH3b1Z1zd5yTBX6h4uiEwddWG8yq0kGQ5TsdUM UEXxlgcmaeaunw2T3BuFwqX0GJdTFLeA39oZq4tqKB3zYqq79vvd2xCa55/MaPkElZvI wQjdx99EjI+v4yGawJQhylGyvXsgkTVS1D5Vc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=tAWmy0gMuXOcZJtdhH+ZjiZQiAbEcdaue2riVUXB+F4=; b=jqCdsL0ndqAXfJNKjbO4xrlZhJLOfwQbMC/idY+UX/YVTsUteUAj4njlK8TSK2fX1y TzRxBZRcgxb8WWS4H9CjI0C7B2M4zY9beyj6E8A4wuCFR9rsOZtKdckwiJ2GrMepDw/e VY1eItnAtWdx5PQ9pCsJaSCTiGZbhDEcGwFktNJ9iKg6cgZmTnVBA8bp4vD5KKfAJG18 sumlq5GsbhP8uTr7Z00pOXchwGO3z7JGmXlNZTJ99vhVaHtoMmQ8x06QtCQztiws8d/h QQgyvLLjiOcdxY+1kkvopqVuFr4eLxGRHbVYrTQUahewabhbqORjk0GWaYKc6HrOIGHr T75w== X-Gm-Message-State: ABuFfojusjgbsgWMtKHZ9SvYvlKclt2Mfq3vUonLRTgrHvnveFRZ+WGf yyaCByByrBP7Rb+lgJJYVxzuAA== X-Received: by 2002:a37:4f53:: with SMTP id d80-v6mr27047020qkb.323.1539181342691; Wed, 10 Oct 2018 07:22:22 -0700 (PDT) Received: from [192.168.1.169] (pool-71-255-245-97.washdc.fios.verizon.net. [71.255.245.97]) by smtp.gmail.com with ESMTPSA id b10-v6sm13495008qkj.25.2018.10.10.07.22.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Oct 2018 07:22:21 -0700 (PDT) Subject: Re: [RFC PATCH 6/7] sched/fair: update cpu_capcity to reflect thermal pressure To: Javi Merino References: <1539102302-9057-1-git-send-email-thara.gopinath@linaro.org> <1539102302-9057-7-git-send-email-thara.gopinath@linaro.org> <20181010055722.GA5038@tesla> Cc: linux-kernel@vger.kernel.org, mingo@redhat.com, peterz@infradead.org, rui.zhang@intel.com, gregkh@linuxfoundation.org, rafael@kernel.org, amit.kachhap@gmail.com, viresh.kumar@linaro.org, edubezval@gmail.com, daniel.lezcano@linaro.org, linux-pm@vger.kernel.org, quentin.perret@arm.com, ionela.voinescu@arm.com, vincent.guittot@linaro.org From: Thara Gopinath Message-ID: <5BBE0B1C.4060508@linaro.org> Date: Wed, 10 Oct 2018 10:22:20 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20181010055722.GA5038@tesla> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/10/2018 01:57 AM, Javi Merino wrote: > On Tue, Oct 09, 2018 at 12:25:01PM -0400, 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. >> >> 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 7deb1d0..8651e55 100644 >> --- a/kernel/sched/fair.c >> +++ b/kernel/sched/fair.c >> @@ -7497,6 +7497,7 @@ static unsigned long scale_rt_capacity(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); > > IIUIC, you are treating thermal pressure as an artificial load on the > cpu. If so, this sounds like a hard to maintain hack. Thermal > pressure have different characteristics to utilization. What happens > if thermal sets the cpu cooling state back to 0 because there is > thermal headroom again? Do we keep adding this artificial load to the > cpu just because there was thermal pressure in the past and let it > decay as if it was cpu load? Setting cpu cooling state back to 0 will decay the thermal pressure back to 0 ? Yes, cpu will not register an instantaneous drop in the cap, it will be decayed down following the PELT signals. > > Cheers, > Javi > -- Regards Thara