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: 7804931 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D41D7BEEE1 for ; Wed, 9 Dec 2015 06:22:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F1EEE204C9 for ; Wed, 9 Dec 2015 06:21:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 014F0204AB for ; Wed, 9 Dec 2015 06:21:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752290AbbLIGUl (ORCPT ); Wed, 9 Dec 2015 01:20:41 -0500 Received: from mail-pa0-f50.google.com ([209.85.220.50]:35999 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751415AbbLIGTh (ORCPT ); Wed, 9 Dec 2015 01:19:37 -0500 Received: by pacdm15 with SMTP id dm15so24605287pac.3 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=GH+/jdtqARoUT96xl+yd6icXTAsmfFGVrkzEhx8KPrNGDuEY95XfcBd/362FfHwrn2 06mfF4LSO2AMvyIRytciHpQ8COJGXDO3IVD6Hy9Qvp6WhIppdTMCjvpRHOMwJlRC2RXL Ps4t08whBO6yZQsFYMKg0IdFZXKmjDgkR8doEce+ePTXme+L5tBe9Jr0RbegSNyqZPv9 mx1mevOh/jsg3PwfhURjP2LcsloBDlV/cE4r9kaKsN0ySWhMWxI2UIT18+gd3F7nQdSr UB50R+QPIPHgFUZiYcujLOqF5Mq8MnI/Bcn8y71s9prOCt0sCJhHcy8CWuYES3ysWdCE /Gpg== X-Gm-Message-State: ALoCoQk0ye3T6at4emYPpkAxuULQOtzjo3qAarlXld0pJA36BSW59XvhXabbvpVK87Fn8uVMeHiiRKD8cgXvvrnvY2La47Swzg== 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-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(+) 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