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: 4476131 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D6F4C9F86C for ; Thu, 3 Jul 2014 16:27:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 08225201FE for ; Thu, 3 Jul 2014 16:27:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A743203B8 for ; Thu, 3 Jul 2014 16:27:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759148AbaGCQ1L (ORCPT ); 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: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 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);