Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3499680yba; Tue, 16 Apr 2019 12:39:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJznHBc0ikaP4whZpzS1aD7rJiWMBIMFPDexrsBdBN6/zKXFE2S6Aw7tkarqBWFtZ0HYGD X-Received: by 2002:a62:6842:: with SMTP id d63mr86544192pfc.9.1555443589633; Tue, 16 Apr 2019 12:39:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555443589; cv=none; d=google.com; s=arc-20160816; b=n1WAc3ZEJfjFVGjwAcT2y4FlV9Q+ZIBgQBQD8lUxLijQYzdgHluDQ03BdI9WSr+S0r jFaCaXUxoUUyQSozGjvht3kLKN4zCmwHIpiO5HyUj/eKhZgCWCgH4+jQY2tEEEAdQD4C cPSRBARu13Y8xZVwtoE2hIo0sKQ6N5Zq/Y6AuogY1ArxkH115Q/qMWOjBNANCU+z8UKc LFMwHrmPTNvcjPF8laXLQsiFsBxq0+whtjN+LKU16rVHPqEaqTAr/m+p7a4XvxV5CS7b 4+7zW3/PtAuiORuiDMjllST8pC11wR7BMpnHGVG9aJf8IjyZd2yHihmXseXr95FsnHqu KEpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=KNbekIfBRRm8uM1KdnvYGnhJo7PPeihMU4LxOw05fOc=; b=G3huIFQMHqird7GscGbsfhoKB6RAEmbdxOeH+WUckMNmQNXCXzXhnMGakGR/MBlORj JsTnop8hWCKth/EER6+ssvXzr4A7Y7qKHyXLwFbvmHfyjWaRYPk7MGyvrAFv5pMVIrLB VCgBM2Wmza7/uhkuNgif2ye8FWGlKKIUD53scFsXsxktMj+EKYTbef23O/Ye8icm1BPs K0cY771jZ2AshQUeUEXLP9cD4QzXrJY2KofseAHn/TbC9h6Mg7CF4O6gD1+7LmcOXy9s kdddDsqH2AIlaUYT3pTuWir9xIZcBwWiXB09EPzd6fgFpER4zNfbS2WO9qO2ow5eVXUo RMAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dPULVRJj; 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 k186si44897669pgd.206.2019.04.16.12.39.33; Tue, 16 Apr 2019 12:39:49 -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=dPULVRJj; 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 S1730294AbfDPTi4 (ORCPT + 99 others); Tue, 16 Apr 2019 15:38:56 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:36414 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729785AbfDPTit (ORCPT ); Tue, 16 Apr 2019 15:38:49 -0400 Received: by mail-qt1-f195.google.com with SMTP id s15so24745855qtn.3 for ; Tue, 16 Apr 2019 12:38:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KNbekIfBRRm8uM1KdnvYGnhJo7PPeihMU4LxOw05fOc=; b=dPULVRJjB3vqxeNVjKurm9q6bgO2XVeQgLiDeXQptGe8f2megTmgP6kpFst3QBJfZW W5bGXDdhGFOMqMwcD8oiGUCOofULwc5Q43oCKAfUdUZXkG2VgW8efkNuJR2fsOzJZpbX 4UR0+IMSYJFc1S6HkZIrhiQXW+6Od/uwjGdhoJFdOjvkUoakOPX8Dk9QiDnhDiqtkFzB bcFEHaYNs+swYiwsToSJh3pNQc/C9icY3uLvZpz1ozTB0TvZZ1ViMYqHLq4Uy5CoaFSg hsYUAbEIOXkWmXLPusFcxBldxHFkWLAoEuIcVT43pUvTsr07s5LmvZutt8TOW874to1S k6+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KNbekIfBRRm8uM1KdnvYGnhJo7PPeihMU4LxOw05fOc=; b=WBdrdeCZqHi088S2x7WH3/HNf7tmr3r/GANdUcJUj5xDKUFoFOpSKxzUZWic+tEVLt +t8J8FN3Dnrkb4LYkyTIdMlCJ7hcGIUC49435Y7bRUFUYBUbz/YiTA1/OLbsNrdngek1 27qsH1BefVxTAje4HTFAp5qk5Z1+wyEzibNdDs2P8kEN21SjaymnZwWVAxB3uu/LbIZb 6NnoRM6KSCEvTnG980U5bZtD8hitIY4lFmYMHYUEFT6+AvIECwn3bQS5Jz1mACC5vzl3 /oCw0qHWUA0NbkL4PEBMciagHWE6wkjhkRGaCjDhcU4Mt+XeAqbgyNtqxbaMP3X9miyU A2Kg== X-Gm-Message-State: APjAAAUJB51+ZpPXM7Kevlw1SatEmYibNVfYnkIUg6nnWbagqf+GYep8 StsNbLSP4i2kSNTJQ8NitT6wag== X-Received: by 2002:a0c:d2f2:: with SMTP id x47mr64643661qvh.90.1555443527688; Tue, 16 Apr 2019 12:38:47 -0700 (PDT) Received: from Thara-Work-Ubuntu.fios-router.home (pool-71-255-245-97.washdc.fios.verizon.net. [71.255.245.97]) by smtp.googlemail.com with ESMTPSA id k41sm46150797qtc.89.2019.04.16.12.38.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Apr 2019 12:38:47 -0700 (PDT) From: Thara Gopinath To: mingo@redhat.com, peterz@infradead.org, rui.zhang@intel.com Cc: linux-kernel@vger.kernel.org, amit.kachhap@gmail.com, viresh.kumar@linaro.org, javi.merino@kernel.org, edubezval@gmail.com, daniel.lezcano@linaro.org, vincent.guittot@linaro.org, nicolas.dechesne@linaro.org, bjorn.andersson@linaro.org, dietmar.eggemann@arm.com Subject: [PATCH V2 2/3] sched/fair: update cpu_capcity to reflect thermal pressure Date: Tue, 16 Apr 2019 15:38:40 -0400 Message-Id: <1555443521-579-3-git-send-email-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1555443521-579-1-git-send-email-thara.gopinath@linaro.org> References: <1555443521-579-1-git-send-email-thara.gopinath@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 8213ff6..c5454d3 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -23,6 +23,7 @@ #include "sched.h" #include +#include /* * Targeted preemption latency for CPU-bound tasks: @@ -7967,6 +7968,9 @@ static void update_cpu_capacity(struct sched_domain *sd, int cpu) if (!capacity) capacity = 1; + capacity *= sched_get_thermal_pressure(cpu); + capacity >>= SCHED_CAPACITY_SHIFT; + cpu_rq(cpu)->cpu_capacity = capacity; sdg->sgc->capacity = capacity; sdg->sgc->min_capacity = capacity; -- 2.1.4