From patchwork Tue Dec 2 14:06:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Morten Rasmussen X-Patchwork-Id: 5420401 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 D9C119F1C5 for ; Tue, 2 Dec 2014 14:09:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 45A1120295 for ; Tue, 2 Dec 2014 14:09:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6386120266 for ; Tue, 2 Dec 2014 14:09:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753671AbaLBOIt (ORCPT ); Tue, 2 Dec 2014 09:08:49 -0500 Received: from service88.mimecast.com ([195.130.217.12]:50584 "EHLO service88.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753872AbaLBOHC (ORCPT ); Tue, 2 Dec 2014 09:07:02 -0500 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by service87.mimecast.com; Tue, 02 Dec 2014 14:07:00 +0000 Received: from e105550-lin.cambridge.arm.com ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 2 Dec 2014 14:06:59 +0000 From: Morten Rasmussen To: peterz@infradead.org, mingo@redhat.com Cc: dietmar.eggemann@arm.com, vincent.guittot@linaro.org, pjt@google.com, bsegall@google.com, mturquette@linaro.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Morten Rasmussen Subject: [RFC PATCH 10/10] sched: Include blocked load in weighted_cpuload Date: Tue, 2 Dec 2014 14:06:32 +0000 Message-Id: <1417529192-11579-11-git-send-email-morten.rasmussen@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1417529192-11579-1-git-send-email-morten.rasmussen@arm.com> References: <1417529192-11579-1-git-send-email-morten.rasmussen@arm.com> X-OriginalArrivalTime: 02 Dec 2014 14:06:59.0947 (UTC) FILETIME=[3D6183B0:01D00E39] X-MC-Unique: 114120214070015201 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=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 Adds blocked_load_avg to weighted_cpuload() to take recently runnable tasks into account in load-balancing decisions. This changes the nature of weighted_cpuload() as it may >0 while there are currently no runnable tasks on the cpu rq. Hence care must be taken in the load-balance code to use cfs_rq->runnable_load_avg or nr_running when current rq status is needed. This patch is highly experimental and will probably have require additional updates of the users of weighted_cpuload(). cc: Ingo Molnar cc: Peter Zijlstra Signed-off-by: Morten Rasmussen --- kernel/sched/fair.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index bd950b2..ad0ebb7 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4349,7 +4349,8 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags) /* Used instead of source_load when we know the type == 0 */ static unsigned long weighted_cpuload(const int cpu) { - return cpu_rq(cpu)->cfs.runnable_load_avg; + return cpu_rq(cpu)->cfs.runnable_load_avg + + cpu_rq(cpu)->cfs.blocked_load_avg; } /*