From patchwork Mon Feb 17 01:55:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 24727 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f199.google.com (mail-ob0-f199.google.com [209.85.214.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 30265203BE for ; Mon, 17 Feb 2014 01:57:22 +0000 (UTC) Received: by mail-ob0-f199.google.com with SMTP id vb8sf56585367obc.6 for ; Sun, 16 Feb 2014 17:57:21 -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=E8Ki6Cj70BQ/uuiMVaBWys5CBEXsoeqdkLFEAf/cuc0=; b=gH0qXo5HdqJKC6PZSWUtDKoIMuKQocRTgGUcWR7fYK8FlFTsLFzYxYszwUipYOVmlh 61bQ4Hcji+wL/JvDOVm0c2VWelATDRPxdfyZXfhfrf/i2dDTTJmPVR7kAqZFvEOPbOO9 X1ZJ0EEqjccuPIkCL7VUJeL/+rrb17rSzMSzRvbrejQxf0zYzJGCUg3Yx3YPOKGxaSfq h5Cbb09fuPPSqVrk3AiBkfS+w1Xi+Zq2l6IPwzI1bVgSpAyE5duN/SWxVP5eVQYucGt0 FVIR4ErCFfmFssFdatObE8bZk44xTIui6WqhC7UyUf9K6fODyFFdB5mh5zjGytBRcuNk nL3Q== X-Gm-Message-State: ALoCoQknVgYLFQPLDhkdiToyMMHCZZ2DfgWRb9GVRdpdAgO4O1JIbYQoqy5mH6k9/7ETTET5UzxL X-Received: by 10.182.129.129 with SMTP id nw1mr9190131obb.34.1392602241213; Sun, 16 Feb 2014 17:57:21 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.84.165 with SMTP id l34ls710804qgd.5.gmail; Sun, 16 Feb 2014 17:57:21 -0800 (PST) X-Received: by 10.220.175.198 with SMTP id bb6mr2974343vcb.31.1392602241113; Sun, 16 Feb 2014 17:57:21 -0800 (PST) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id si7si4169809vdc.24.2014.02.16.17.57.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 16 Feb 2014 17:57:21 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.169; Received: by mail-ve0-f169.google.com with SMTP id oy12so11801132veb.0 for ; Sun, 16 Feb 2014 17:57:21 -0800 (PST) X-Received: by 10.220.95.139 with SMTP id d11mr10766302vcn.21.1392602241019; Sun, 16 Feb 2014 17:57:21 -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 u4csp102414vcz; Sun, 16 Feb 2014 17:57:20 -0800 (PST) X-Received: by 10.66.227.104 with SMTP id rz8mr23619254pac.74.1392602240049; Sun, 16 Feb 2014 17:57:20 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i8si13045046pav.103.2014.02.16.17.57.19; Sun, 16 Feb 2014 17:57:19 -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 S1754050AbaBQB5N (ORCPT + 27 others); Sun, 16 Feb 2014 20:57:13 -0500 Received: from mail-pb0-f44.google.com ([209.85.160.44]:65319 "EHLO mail-pb0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752721AbaBQB5K (ORCPT ); Sun, 16 Feb 2014 20:57:10 -0500 Received: by mail-pb0-f44.google.com with SMTP id rq2so14724523pbb.3 for ; Sun, 16 Feb 2014 17:57:09 -0800 (PST) X-Received: by 10.66.139.100 with SMTP id qx4mr839420pab.141.1392602229716; Sun, 16 Feb 2014 17:57:09 -0800 (PST) Received: from localhost.localdomain ([116.232.92.15]) by mx.google.com with ESMTPSA id eo11sm104524083pac.0.2014.02.16.17.56.58 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 16 Feb 2014 17:57:08 -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 Subject: [PATCH v2 07/11] sched: clean up weighted_cpuload Date: Mon, 17 Feb 2014 09:55:13 +0800 Message-Id: <1392602117-20773-8-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1392602117-20773-1-git-send-email-alex.shi@linaro.org> References: <1392602117-20773-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.128.169 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: , weighted_cpuload is used instead of source_load() when !idx. Now idx is always 0. so unify the usage to soruce_load. That make code more readable. Signed-off-by: Alex Shi --- kernel/sched/fair.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 2da0e3b..5cdc838 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -1045,7 +1045,7 @@ static void update_numa_stats(struct numa_stats *ns, int nid) struct rq *rq = cpu_rq(cpu); ns->nr_running += rq->nr_running; - ns->load += weighted_cpuload(cpu); + ns->load += source_load(cpu); ns->power += power_of(cpu); cpus++; @@ -3940,7 +3940,7 @@ 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 */ -static unsigned long weighted_cpuload(const int cpu) +static inline unsigned long weighted_cpuload(const int cpu) { return cpu_rq(cpu)->cfs.runnable_load_avg; } @@ -4324,7 +4324,7 @@ find_idlest_cpu(struct sched_group *group, struct task_struct *p, int this_cpu) /* Traverse only the allowed CPUs */ for_each_cpu_and(i, sched_group_cpus(group), tsk_cpus_allowed(p)) { - load = weighted_cpuload(i); + load = source_load(i); if (load < min_load || (load == min_load && i == this_cpu)) { min_load = load; @@ -5762,7 +5762,7 @@ static inline void update_sg_lb_stats(struct lb_env *env, sgs->nr_numa_running += rq->nr_numa_running; sgs->nr_preferred_running += rq->nr_preferred_running; #endif - sgs->sum_weighted_load += weighted_cpuload(i); + sgs->sum_weighted_load += source_load(i); if (idle_cpu(i)) sgs->idle_cpus++; } @@ -6248,10 +6248,10 @@ static struct rq *find_busiest_queue(struct lb_env *env, if (!capacity) capacity = fix_small_capacity(env->sd, group); - wl = weighted_cpuload(i); + wl = source_load(i); /* - * When comparing with imbalance, use weighted_cpuload() + * When comparing with imbalance, use source_load() * which is not scaled with the cpu power. */ if (capacity && rq->nr_running == 1 && wl > env->imbalance) @@ -6259,7 +6259,7 @@ static struct rq *find_busiest_queue(struct lb_env *env, /* * For the load comparisons with the other cpu's, consider - * the weighted_cpuload() scaled with the cpu power, so that + * the source_load() scaled with the cpu power, so that * the load can be moved away from the cpu that is potentially * running at a lower capacity. *