From patchwork Tue Feb 25 01:50:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 25228 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7FBCA2066E for ; Tue, 25 Feb 2014 01:52:48 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id m5sf10484692qaj.1 for ; Mon, 24 Feb 2014 17:52:48 -0800 (PST) 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; bh=wvS/OOWxQMZKeHu/ELaPlf9fVzuEdnI0ivk+0n85pKw=; b=TSh076yiPCq4Ji9KDbJlyCd7AZvGCCf5vBk71UqoqnNBg/GTV1TxgQLBfpxm8PG/ed wa4LMc0fRG0ocqZkLOvG18kj25IWeHeYjBXtxeaz2/4W+v+Gv5rOE1lbFMvGwxJqRtH6 +xZlLy/2MRh0Tz3H7ig2qAa+ycfu4cYwVg98iegoh3WnwviOb0AT8QlYphSVVRCa61es pGsPP9IGlamMu+0Z0eHHgj67HJzEpfqTmjrjpYzVFXyfxnDFmvXPzFp55Rtt4O+eZXdz DooLYt8Bnx5nVfnx2G4o/2VaRkP72JdC92dWIsz65OVdytnVKAK1Bd3pQwTisAJh9A8W 7ysA== X-Gm-Message-State: ALoCoQmvetrm6SQfvtKhMDOnqy8k2vII/EYpLhw+40rgqW0oSWkeoaKHKql8OuKDyzL00BUuz1Lw X-Received: by 10.58.171.135 with SMTP id au7mr180457vec.22.1393293168092; Mon, 24 Feb 2014 17:52:48 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.47.9 with SMTP id l9ls2325832qga.13.gmail; Mon, 24 Feb 2014 17:52:48 -0800 (PST) X-Received: by 10.58.48.133 with SMTP id l5mr59503ven.36.1393293167977; Mon, 24 Feb 2014 17:52:47 -0800 (PST) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id tr5si6411671vdc.13.2014.02.24.17.52.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Feb 2014 17:52:47 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id lg15so2985847vcb.12 for ; Mon, 24 Feb 2014 17:52:47 -0800 (PST) X-Received: by 10.220.164.80 with SMTP id d16mr14766354vcy.15.1393293167871; Mon, 24 Feb 2014 17:52:47 -0800 (PST) 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.220.174.196 with SMTP id u4csp103204vcz; Mon, 24 Feb 2014 17:52:46 -0800 (PST) X-Received: by 10.68.93.161 with SMTP id cv1mr3328737pbb.122.1393293165950; Mon, 24 Feb 2014 17:52:45 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id nc5si18725258pab.242.2014.02.24.17.52.45; Mon, 24 Feb 2014 17:52:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753479AbaBYBwi (ORCPT + 26 others); Mon, 24 Feb 2014 20:52:38 -0500 Received: from mail-pb0-f52.google.com ([209.85.160.52]:53772 "EHLO mail-pb0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752635AbaBYBwc (ORCPT ); Mon, 24 Feb 2014 20:52:32 -0500 Received: by mail-pb0-f52.google.com with SMTP id rr13so870826pbb.25 for ; Mon, 24 Feb 2014 17:52:32 -0800 (PST) X-Received: by 10.66.25.101 with SMTP id b5mr28981181pag.101.1393293152256; Mon, 24 Feb 2014 17:52:32 -0800 (PST) Received: from localhost.localdomain ([116.232.61.20]) by mx.google.com with ESMTPSA id q7sm4499844pbc.20.2014.02.24.17.52.21 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Feb 2014 17:52:31 -0800 (PST) From: Alex Shi To: mingo@redhat.com, peterz@infradead.org, morten.rasmussen@arm.com Cc: vincent.guittot@linaro.org, daniel.lezcano@linaro.org, fweisbec@gmail.com, linux@arm.linux.org.uk, tony.luck@intel.com, fenghua.yu@intel.com, james.hogan@imgtec.com, alex.shi@linaro.org, jason.low2@hp.com, viresh.kumar@linaro.org, hanjun.guo@linaro.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, akpm@linux-foundation.org, arjan@linux.intel.com, pjt@google.com, fengguang.wu@intel.com, linaro-kernel@lists.linaro.org, wangyun@linux.vnet.ibm.com, mgorman@suse.de Subject: [PATCH 07/11] sched: replace source_load by weighted_cpuload Date: Tue, 25 Feb 2014 09:50:50 +0800 Message-Id: <1393293054-11378-8-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1393293054-11378-1-git-send-email-alex.shi@linaro.org> References: <1393293054-11378-1-git-send-email-alex.shi@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: alex.shi@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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: , Now, without load_idx source_load is just weighted_cpuload, so replace it to reduce a conception for cpu load. Signed-off-by: Alex Shi --- kernel/sched/fair.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index c5821b5..5feb51b 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -1015,7 +1015,6 @@ bool should_numa_migrate_memory(struct task_struct *p, struct page * page, } static unsigned long weighted_cpuload(const int cpu); -static unsigned long source_load(int cpu); static unsigned long target_load(int cpu, int imbalance_pct); static unsigned long power_of(int cpu); static long effective_load(struct task_group *tg, int cpu, long wl, long wg); @@ -3949,27 +3948,15 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags) } #ifdef CONFIG_SMP -/* Used instead of source_load when we know the type == 0 */ +/* weighted cpu load with runnable time, 'nice' value on CFS class */ static unsigned long weighted_cpuload(const int cpu) { return cpu_rq(cpu)->cfs.runnable_load_avg; } /* - * Return a low guess at the load of a migration-source cpu weighted - * according to the scheduling class and "nice" value. - * - * We want to under-estimate the load of migration sources, to - * balance conservatively. - */ -static unsigned long source_load(int cpu) -{ - return weighted_cpuload(cpu); -} - -/* * Return a high guess at the load of a migration-target cpu weighted - * according to the scheduling class and "nice" value. + * according to the runnable time and "nice" value. */ static unsigned long target_load(int cpu, int imbalance_pct) { @@ -4297,7 +4284,7 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p, int this_cpu) for_each_cpu(i, sched_group_cpus(group)) { /* Bias balancing toward cpus of our domain */ if (local_group) - load = source_load(i); + load = weighted_cpuload(i); else load = target_load(i, imbalance); @@ -5752,7 +5739,7 @@ static inline void update_sg_lb_stats(struct lb_env *env, if (local_group && env->idle != CPU_IDLE) load = target_load(i, bias); else - load = source_load(i); + load = weighted_cpuload(i); sgs->group_load += load; sgs->sum_nr_running += rq->nr_running;