From patchwork Thu Oct 25 10:25:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: preeti X-Patchwork-Id: 1643001 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 87AAB3FE1C for ; Thu, 25 Oct 2012 10:30:00 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TRKdZ-00013b-Oy; Thu, 25 Oct 2012 10:26:05 +0000 Received: from e28smtp07.in.ibm.com ([122.248.162.7]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TRKdU-00010U-97 for linux-arm-kernel@lists.infradead.org; Thu, 25 Oct 2012 10:26:01 +0000 Received: from /spool/local by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 25 Oct 2012 15:55:53 +0530 Received: from d28relay01.in.ibm.com (9.184.220.58) by e28smtp07.in.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 25 Oct 2012 15:55:51 +0530 Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q9PAPorp34603114 for ; Thu, 25 Oct 2012 15:55:50 +0530 Received: from d28av05.in.ibm.com (loopback [127.0.0.1]) by d28av05.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q9PFtRuE024020 for ; Fri, 26 Oct 2012 02:55:31 +1100 Received: from preeti.in.ibm.com (preeti.in.ibm.com [9.124.35.56]) by d28av05.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q9PFtQ0s023957; Fri, 26 Oct 2012 02:55:26 +1100 Subject: [RFC PATCH 04/13] sched:Decide group_imb using 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:27 +0530 Message-ID: <20121025102526.21022.64324.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-8878-0000-0000-00000482047F 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 ---- ---------------------- -------------------------------------------------- 3.0 KHOP_BIG_TO_CC Sent to 10+ recipients instaed of Bcc or a list -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [122.248.162.7 listed in list.dnswl.org] -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 Additional parameters for deciding a sched group's imbalance status which are calculated using the per entity load tracking are used. Signed-off-by: Preeti U Murthy --- kernel/sched/fair.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 67a916d..77363c6 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3748,6 +3748,7 @@ struct lb_env { int new_dst_cpu; enum cpu_idle_type idle; long imbalance; + long long load_imbalance; /* PJT metric equivalent of imbalance */ /* The set of CPUs under consideration for load-balancing */ struct cpumask *cpus; @@ -4513,6 +4514,11 @@ static inline void update_sg_lb_stats(struct lb_env *env, unsigned long load, max_cpu_load, min_cpu_load; unsigned int balance_cpu = -1, first_idle_cpu = 0; unsigned long avg_load_per_task = 0; + + /* Decide imb based on PJT's metric */ + u64 cpu_runnable_load, max_cpu_runnable_load, min_cpu_runnable_load; + u64 avg_sg_load_per_task = 0; + int i; if (local_group) @@ -4521,6 +4527,8 @@ static inline void update_sg_lb_stats(struct lb_env *env, /* Tally up the load of all CPUs in the group */ max_cpu_load = 0; min_cpu_load = ~0UL; + max_cpu_runnable_load = 0; + min_cpu_runnable_load = ~0ULL; max_nr_running = 0; min_nr_running = ~0UL; @@ -4545,6 +4553,12 @@ static inline void update_sg_lb_stats(struct lb_env *env, if (min_cpu_load > load) min_cpu_load = load; + cpu_runnable_load = cpu_rq(i)->cfs.runnable_load_avg; + if (cpu_runnable_load > max_cpu_runnable_load) + max_cpu_runnable_load = cpu_runnable_load; + if (min_cpu_runnable_load > cpu_runnable_load) + min_cpu_runnable_load = cpu_runnable_load; + if (nr_running > max_nr_running) max_nr_running = nr_running; if (min_nr_running > nr_running) @@ -4604,10 +4618,13 @@ static inline void update_sg_lb_stats(struct lb_env *env, * normalized nr_running number somewhere that negates * the hierarchy? */ - if (sgs->sum_nr_running) + if (sgs->sum_nr_running) { avg_load_per_task = sgs->sum_weighted_load / sgs->sum_nr_running; + avg_sg_load_per_task = sgs->group_cfs_runnable_load / sgs->sum_nr_running; + } - if ((max_cpu_load - min_cpu_load) >= avg_load_per_task && + /* The following decision is made on PJT's metric */ + if ((max_cpu_runnable_load - min_cpu_runnable_load) >= avg_sg_load_per_task && (max_nr_running - min_nr_running) > 1) sgs->group_imb = 1; @@ -5047,6 +5064,7 @@ out_balanced: ret: env->imbalance = 0; + env->load_imbalance = 0; return NULL; }