From patchwork Tue Oct 9 16:25:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 148513 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp5109765lji; Tue, 9 Oct 2018 09:25:19 -0700 (PDT) X-Google-Smtp-Source: ACcGV63++R2ooO8Zl+3zaTkIsfPgYvh8Tyi1f9Hl4PLLhOFMn+QZbMd5aAquyiGDvBCd5H6nLRbW X-Received: by 2002:a63:fc23:: with SMTP id j35-v6mr25274799pgi.1.1539102319840; Tue, 09 Oct 2018 09:25:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539102319; cv=none; d=google.com; s=arc-20160816; b=DTUsoU3wkKlEXPvc6D/geqBVZnwmlwe5qpl7oVX1kXpluhaMf0v0JG6QdqhVLbETgf swlem8CUWy60YtqlUgRdvIWgHKu+Nr+xhFo3agdXfN2l7pn9Nqy2gOPEDLjbbM5yuLL3 YfGs5RFWdoOha44NGSCImdlraEZPLcBbRNMnHWbvmz9n1abq9HPbxbI4iBg321gOzqKl fgPIK7fwsO7YUE0w/T26OqnA9WU7nsHNYXm0GZ+ufF6TepxNxzxvVsOplGr93FOLJ6At 0X2ru8HnjIG9diTdnqt913FYFTzim5WQuVIIzUAhdrXitrz9ytk5f/Q9aOAwK+4/W36Z MYwg== 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=zIbq74SHzUmAAn9beXqSbIF0xv76+VwJaPbFBIeIe1U=; b=h0jI7YC7pc3AZgUmoF9+MoFVoWauwvpw82F/u3W9y3zbliAFpd7UEYtiDWXscarK42 Lh/+iTCHvyWSKXD3+3h6kLR434WA4M/2ME4Cfl7BL3RqoblQAGQ/7fhpHUQB75VcjDHx RO3OAsI9LxeIW4a8tlRuo+AzM10BsSO0SwdKQ9xH9T8C1kZ8HhbrraNjr5jrvEXDlmcU 8DyVdICKIV1t5Eik3Wg+m9GJv1YJhk9VdO5zdHANIERFDVmzDqdJg6vzwAog0uPLDeAj AWb4lSiast1HqqRSlt9eMiHL9/fK1AsANb6HXH6F39mTFwnYAyGe1sXFvNI/CEzVpYlL A2yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kdY7h6gD; 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 g6-v6si19960506pgb.408.2018.10.09.09.25.19; Tue, 09 Oct 2018 09:25:19 -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=kdY7h6gD; 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 S1727361AbeJIXnA (ORCPT + 32 others); Tue, 9 Oct 2018 19:43:00 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:40908 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727344AbeJIXnA (ORCPT ); Tue, 9 Oct 2018 19:43:00 -0400 Received: by mail-qt1-f193.google.com with SMTP id b4-v6so2290317qtc.7 for ; Tue, 09 Oct 2018 09:25:16 -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=zIbq74SHzUmAAn9beXqSbIF0xv76+VwJaPbFBIeIe1U=; b=kdY7h6gD1j1ZOLtPzQxEfbc4s3OD13OAN015eqld8teNR3+nmmjs/yTd5FpiU0di87 qpUqMO8Ns1pedoP0cGypsMgs2UXMZqoWFLcxwWAjKO6dfseK3ibqVv3MH+mTC/ttnPl+ 8bAduK1OBfF087dvUgV/UImLxOwwIHScBIC9c= 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=zIbq74SHzUmAAn9beXqSbIF0xv76+VwJaPbFBIeIe1U=; b=so5ZN5aLRFWvi/3D6ImffHKuHuAiYPa9UI5+mavPS4pVl8H9CQ6R/fsv04DRR9Z5Bb dzaRWxeGQGf1OhUB4iWymU2K8Lkr7hDrAlw3UHV8qCoJ6cKCE/7UQ6EwiykL0hXZBr32 wq6H1WDtpGBiwkcTvc8SE0AxDveMPrcV6+IUf5SOUTJxfkCAHjBs/pkuDZb60d4nIzGG AXV7tdgvqONajHfevLq8r8gw4Ul8WVevds/6Ck0FEwGUlAu8OfmxIqxYkJLTmCqrP6gY NEdcE3vjPvCl6CuTlIziwZ3olMQsEt5cSqcnUtvZbkTw1DE0yJUnNxWhR69ByEbdFsFZ GUZg== X-Gm-Message-State: ABuFfogDpMF8RshqJjw3+Q1J7XowIPekZ3Ai8y4whfQNqOTBhIHD64mJ zQrLlHPjFoESqcpClC78dPJDhGdhcHMbkw== X-Received: by 2002:aed:3342:: with SMTP id u60-v6mr20271131qtd.177.1539102315988; Tue, 09 Oct 2018 09:25:15 -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 o7-v6sm10441169qkc.67.2018.10.09.09.25.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Oct 2018 09:25:15 -0700 (PDT) From: Thara Gopinath To: linux-kernel@vger.kernel.org, mingo@redhat.com, peterz@infradead.org, rui.zhang@intel.com Cc: gregkh@linuxfoundation.org, rafael@kernel.org, amit.kachhap@gmail.com, viresh.kumar@linaro.org, javi.merino@kernel.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 Subject: [RFC PATCH 6/7] sched/fair: update cpu_capcity to reflect thermal pressure Date: Tue, 9 Oct 2018 12:25:01 -0400 Message-Id: <1539102302-9057-7-git-send-email-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1539102302-9057-1-git-send-email-thara.gopinath@linaro.org> References: <1539102302-9057-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 | 1 + 1 file changed, 1 insertion(+) -- 2.1.4 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); if (unlikely(used >= max)) return 1;