From patchwork Thu Jul 3 16:26:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Morten Rasmussen X-Patchwork-Id: 33039 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1D33D203AC for ; Thu, 3 Jul 2014 16:27:41 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id m5sf1018754qaj.6 for ; Thu, 03 Jul 2014 09:27:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=BNEdgP+NjC+JvtgnppfBY5IUU+XqXbtrCQ2xrfe5tiA=; b=CjwoNeEva7pxfPL4Q4+S++0iRYY8nfnov4XvcRghY4/V4dQEgQgcLhokEQuaFJ938o D7nxjnrAYMNiuueXGArOy/jNXMGcHsnCuNuwAQHxI7ywDajZoiQqFDouPS4LWN8KqBqy xx0dBwG8YCJ8/uCJq1Qr1peA/7hVHcZt3Pme/Dv7Mu5paChlkB/wB7DHEl3rj7AMFEzK O7hY9tNZntjbV/ALZggorWs11ZYafZAErFBfsDI5ca3Rh6Zy2nOjx1lJtLJYcOnf6W4T F0NCUTt8z7tJGgWJvIJ+hNYs1m+ADNTF4WGG7lqL7Nky0Z8Yxvf5bqasDincfw4BdJ4o ziKg== X-Gm-Message-State: ALoCoQmPkfJVH6ffNJiycPPb0TeD/0Xzd7jn7tr7glBjGbFK4EotvqAwjzqafZZQc/fAZ+53bowU X-Received: by 10.58.69.232 with SMTP id h8mr2826374veu.36.1404404860946; Thu, 03 Jul 2014 09:27:40 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.38.114 with SMTP id s105ls558890qgs.64.gmail; Thu, 03 Jul 2014 09:27:40 -0700 (PDT) X-Received: by 10.220.163.201 with SMTP id b9mr50595vcy.79.1404404860871; Thu, 03 Jul 2014 09:27:40 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id l3si8985960vdv.50.2014.07.03.09.27.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Jul 2014 09:27:40 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id hy4so463374vcb.33 for ; Thu, 03 Jul 2014 09:27:40 -0700 (PDT) X-Received: by 10.52.0.177 with SMTP id 17mr4065115vdf.12.1404404860683; Thu, 03 Jul 2014 09:27:40 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp390403vcb; Thu, 3 Jul 2014 09:27:40 -0700 (PDT) X-Received: by 10.66.250.161 with SMTP id zd1mr5586877pac.61.1404404859163; Thu, 03 Jul 2014 09:27:39 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ho4si33280366pbc.180.2014.07.03.09.27.38; Thu, 03 Jul 2014 09:27:38 -0700 (PDT) Received-SPF: none (google.com: linux-pm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759148AbaGCQ1L (ORCPT + 13 others); Thu, 3 Jul 2014 12:27:11 -0400 Received: from service87.mimecast.com ([91.220.42.44]:47352 "EHLO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758267AbaGCQ0y (ORCPT ); Thu, 3 Jul 2014 12:26:54 -0400 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Thu, 03 Jul 2014 17:26:21 +0100 Received: from e103034-lin.cambridge.arm.com ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 3 Jul 2014 17:26:20 +0100 From: Morten Rasmussen To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, peterz@infradead.org, mingo@kernel.org Cc: rjw@rjwysocki.net, vincent.guittot@linaro.org, daniel.lezcano@linaro.org, preeti@linux.vnet.ibm.com, Dietmar.Eggemann@arm.com, pjt@google.com Subject: [RFCv2 PATCH 17/23] sched: Likely idle state statistics placeholder Date: Thu, 3 Jul 2014 17:26:04 +0100 Message-Id: <1404404770-323-18-git-send-email-morten.rasmussen@arm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1404404770-323-1-git-send-email-morten.rasmussen@arm.com> References: <1404404770-323-1-git-send-email-morten.rasmussen@arm.com> X-OriginalArrivalTime: 03 Jul 2014 16:26:20.0272 (UTC) FILETIME=[85BBDF00:01CF96DB] X-MC-Unique: 114070317262108801 Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: morten.rasmussen@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The scheduler is currently completely unaware of idle-states. To make informed decisions using the sched_group_energy idle_states list it is necessary to know which idle-state a cpu (or group of cpus) is most likely to be in when it is idle. For example when migrating a task that wakes up periodically, the wakeup energy expense depends on the idle-state the destination cpu is most likely to be in when idle. Signed-off-by: Morten Rasmussen --- kernel/sched/fair.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 9720f04..353e2d0 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4254,6 +4254,19 @@ static inline bool energy_aware(void) return sched_feat(ENERGY_AWARE); } +/* + * Returns the index of the most likely idle-state that the sched_group is in + * when idle. The index can be used to identify the idle-state in the + * sched_group_energy idle_states list. + * + * This is currently just a placeholder. The information needs to come from + * cpuidle. + */ +static inline int likely_idle_state_idx(struct sched_group *sg) +{ + return 0; +} + static int wake_wide(struct task_struct *p) { int factor = this_cpu_read(sd_llc_size);