Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5083620imm; Tue, 9 Oct 2018 09:26:16 -0700 (PDT) X-Google-Smtp-Source: ACcGV63fjOamT4yNYZxGICu4riOH7j7QGa7g7IZycnjldf6wFq/mVeNALN9wP9xnb5ZtSTJ5Yx4C X-Received: by 2002:a63:1b0b:: with SMTP id b11-v6mr26010472pgb.66.1539102376766; Tue, 09 Oct 2018 09:26:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539102376; cv=none; d=google.com; s=arc-20160816; b=RSuoMz/Z2M/xp2+RQiN5CUlkRXbtmmOiRqI3++mTQPrNYZkXGpAA/TyPqABzv6lgR0 vECAn4C4tEN/ba+fc9Mx+2IsXv1PCqAffGTve8KPyEimAd2np6KCkt20z32oIHI1oYcy TWCYNcI9DTeUx73kiMmykEmSYVs4PA4F06bt1ElwdrZDodSmv8T4TOeErZCBG4rm6WBI zi7A3SdBMxs8fVeRk0u6iKT3OQrz1bDG+I+NPChJNn4nO3t0zohlx2qBlozTeKWLaKn2 1437SSKIWHY1lJvBdfCjzwfERIEyyhviCecqHyN6PZrTZjNxyt4/hOrApZCrZVXd54sj MJgQ== 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 t21-v6si21727331pgn.56.2018.10.09.09.26.01; Tue, 09 Oct 2018 09:26:16 -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 S1727353AbeJIXnA (ORCPT + 99 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(+) 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; -- 2.1.4