From patchwork Thu Oct 25 10:25:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: preeti X-Patchwork-Id: 1643031 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 174C03FE1C for ; Thu, 25 Oct 2012 10:31:39 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TRKf1-0001ig-4u; Thu, 25 Oct 2012 10:27:36 +0000 Received: from e28smtp04.in.ibm.com ([122.248.162.4]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TRKdj-00016W-Oh for linux-arm-kernel@lists.infradead.org; Thu, 25 Oct 2012 10:26:17 +0000 Received: from /spool/local by e28smtp04.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 25 Oct 2012 15:56:09 +0530 Received: from d28relay02.in.ibm.com (9.184.220.59) by e28smtp04.in.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 25 Oct 2012 15:56:08 +0530 Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay02.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q9PAQ7sv40304800 for ; Thu, 25 Oct 2012 15:56:07 +0530 Received: from d28av02.in.ibm.com (loopback [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q9PFt3X3020434 for ; Fri, 26 Oct 2012 02:55:07 +1100 Received: from preeti.in.ibm.com (preeti.in.ibm.com [9.124.35.56]) by d28av02.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q9PFt2nT020413; Fri, 26 Oct 2012 02:55:03 +1100 Subject: [RFC PATCH 07/13] sched: Change move_tasks to use PJT's metric To: svaidy@linux.vnet.ibm.com, linux-kernel@vger.kernel.org From: Preeti U Murthy Date: Thu, 25 Oct 2012 15:55:43 +0530 Message-ID: <20121025102543.21022.97196.stgit@preeti.in.ibm.com> In-Reply-To: <20121025102045.21022.92489.stgit@preeti.in.ibm.com> References: <20121025102045.21022.92489.stgit@preeti.in.ibm.com> User-Agent: StGit/0.16-38-g167d MIME-Version: 1.0 x-cbid: 12102510-5564-0000-0000-000005075FF5 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [122.248.162.4 listed in list.dnswl.org] 3.0 KHOP_BIG_TO_CC Sent to 10+ recipients instaed of Bcc or a list -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Morten.Rasmussen@arm.com, venki@google.com, robin.randhawa@arm.com, linaro-dev@lists.linaro.org, a.p.zijlstra@chello.nl, mjg59@srcf.ucam.org, viresh.kumar@linaro.org, amit.kucheria@linaro.org, deepthi@linux.vnet.ibm.com, Arvind.Chauhan@arm.com, paul.mckenney@linaro.org, suresh.b.siddha@intel.com, tglx@linutronix.de, srivatsa.bhat@linux.vnet.ibm.com, vincent.guittot@linaro.org, akpm@linux-foundation.org, paulmck@linux.vnet.ibm.com, arjan@linux.intel.com, mingo@kernel.org, linux-arm-kernel@lists.infradead.org, pjt@google.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Make decisions based on PJT's metrics and the dependent metrics about which tasks to move to reduce the imbalance. Signed-off-by: Preeti U Murthy --- kernel/sched/fair.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index bb1c71b..bd7b69d 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3957,7 +3957,7 @@ static int move_tasks(struct lb_env *env) unsigned long load; int pulled = 0; - if (env->imbalance <= 0) + if (env->load_imbalance <= 0) return 0; again: @@ -3984,7 +3984,8 @@ again: if (sched_feat(LB_MIN) && load < 16 && !env->sd->nr_balance_failed) goto next; - if ((load / 2) > env->imbalance) + /* The below being changed to use the PJT's metric */ + if ((load / 2) > env->load_imbalance) goto next; if (!can_migrate_task(p, env)) @@ -3992,7 +3993,8 @@ again: move_task(p, env); pulled++; - env->imbalance -= load; + /* Using PJT's metric */ + env->load_imbalance -= load; #ifdef CONFIG_PREEMPT /* @@ -4007,8 +4009,9 @@ again: /* * We only want to steal up to the prescribed amount of * weighted load. + * But the below modification is to use PJT's metric */ - if (env->imbalance <= 0) + if (env->load_imbalance <= 0) goto out; continue; @@ -4145,7 +4148,8 @@ static inline void update_h_load(long cpu) static unsigned long task_h_load(struct task_struct *p) { - return p->se.load.weight; + /* The below is changed to use PJT's metric*/ + return p->se.avg.load_avg_contrib; } #endif