From patchwork Wed Dec 9 06:19:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Muckle X-Patchwork-Id: 57929 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp480212lbb; Tue, 8 Dec 2015 22:21:07 -0800 (PST) X-Received: by 10.98.12.205 with SMTP id 74mr10448472pfm.53.1449642067201; Tue, 08 Dec 2015 22:21:07 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rx5si10339549pab.151.2015.12.08.22.21.06; Tue, 08 Dec 2015 22:21:07 -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; 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; dkim=neutral (body hash did not verify) header.i=@linaro-org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753423AbbLIGUu (ORCPT + 28 others); Wed, 9 Dec 2015 01:20:50 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:34004 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751451AbbLIGTh (ORCPT ); Wed, 9 Dec 2015 01:19:37 -0500 Received: by pacwq6 with SMTP id wq6so24475005pac.1 for ; Tue, 08 Dec 2015 22:19:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4hF7b8sZ4OhtwfpeXxqcIKhFD1qV75tkdsvchWhNJuQ=; b=xIox8DU0SW+hzO/iwD6wncdSs5+3a0A1MgPXCIrrprbMtnTQxuNQI8IizmyXpu4nwP U68Y/XZmo5cY/IuADWytNgdPFUfzG/XurlNvcV/OmHMjjP1UmG7rz0zXdS/S7wdVfnN1 yMgY7mfqgqQG9+oJaObNqdEPx7u+UViVHQA9X+zp0QbKR2s1B6wJDnBBmr7SNtsnKpJx UqA9bnmpgmTscgtRFDz/rKNi6mmfTOhWMCn1tyQ2dTe2bDcyCg7ZYi5VqOKocZxBdufc KLblE2udkpr3FKwh5PWuQf1u7az++ZQRSMaTjh8jZxY5iAe8otLY/LHwZvlnxCHZADYi UexQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4hF7b8sZ4OhtwfpeXxqcIKhFD1qV75tkdsvchWhNJuQ=; b=QYSFBAFk8lrGt05EJ9r2UShVn0nXys5Nkgp9DtIvme4LPp782W9J8T6Jf/U5PNo2eV qX/UVd+SGXt29c6cY+5+yIv5O7lUR3K0mxUUqCW3Tz9T2oal/KivV0M+v7JUEPm0nMyE 8GWeRLNVtWuuUsnlNBq+l33cBST0f1GuQSRDKi3SA/JqcDxgIsx5DM84aK2crM1hiw4a XH9LPeIUCxIrQdbmwbYkREbFMcK43fGOG+M0FkZABOqRusSpSp94QK+QfSop/By0NkTm J5G+UNxH4mfYPqidLkYHTZ+HlxzyKmZqmUNhbhQNZyXEZGZVgwOU3qWHSCuE/xNcpylN 9hDQ== X-Gm-Message-State: ALoCoQmQi73LW5OUf5zNQ2+w0ZFKyp43nGmGLkJFZVASEOQWhjSHthsHAHWxgGS6A2AX2HurFNOEiRADnLe+pqFDXr2Myg4ERw== X-Received: by 10.66.119.202 with SMTP id kw10mr5576797pab.49.1449641976949; Tue, 08 Dec 2015 22:19:36 -0800 (PST) Received: from graphite.smuckle.net (cpe-75-80-155-7.san.res.rr.com. [75.80.155.7]) by smtp.gmail.com with ESMTPSA id l84sm8643078pfb.15.2015.12.08.22.19.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Dec 2015 22:19:36 -0800 (PST) From: Steve Muckle X-Google-Original-From: Steve Muckle To: Peter Zijlstra , Ingo Molnar Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Vincent Guittot , Morten Rasmussen , Dietmar Eggemann , Juri Lelli , Patrick Bellasi , Michael Turquette Subject: [RFCv6 PATCH 01/10] sched: Compute cpu capacity available at current frequency Date: Tue, 8 Dec 2015 22:19:22 -0800 Message-Id: <1449641971-20827-2-git-send-email-smuckle@linaro.org> X-Mailer: git-send-email 2.4.10 In-Reply-To: <1449641971-20827-1-git-send-email-smuckle@linaro.org> References: <1449641971-20827-1-git-send-email-smuckle@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Morten Rasmussen capacity_orig_of() returns the max available compute capacity of a cpu. For scale-invariant utilization tracking and energy-aware scheduling decisions it is useful to know the compute capacity available at the current OPP of a cpu. cc: Ingo Molnar cc: Peter Zijlstra Signed-off-by: Morten Rasmussen Signed-off-by: Steve Muckle --- kernel/sched/fair.c | 11 +++++++++++ 1 file changed, 11 insertions(+) -- 2.4.10 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 1093873..95b83c4 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4737,6 +4737,17 @@ static long effective_load(struct task_group *tg, int cpu, long wl, long wg) #endif /* + * Returns the current capacity of cpu after applying both + * cpu and freq scaling. + */ +static unsigned long capacity_curr_of(int cpu) +{ + return cpu_rq(cpu)->cpu_capacity_orig * + arch_scale_freq_capacity(NULL, cpu) + >> SCHED_CAPACITY_SHIFT; +} + +/* * Detect M:N waker/wakee relationships via a switching-frequency heuristic. * A waker of many should wake a different task than the one last awakened * at a frequency roughly N times higher than one of its wakees. In order