From patchwork Mon Feb 24 05:12:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 25166 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f200.google.com (mail-ie0-f200.google.com [209.85.223.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E4ADF20972 for ; Mon, 24 Feb 2014 05:14:04 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id to1sf20429522ieb.7 for ; Sun, 23 Feb 2014 21:14:04 -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=kJdU1gdxUiJ4GGzH4XjM+njRpELQcxaOIJ7/Ixs3sHY=; b=hbCBtjgdMKrEd3HRWBt5za+OERU55OzRyYuJhW/Pat35G8gYez8Lgq960ywRbB+J5u L6RXjgzOY9wDkQCy2JvOaE7kwWr0W58Wc5nZKWI1csZW0hYjBVBCO36WmNTOKpEpHKIg cl6BXPrmWq+Ss+3+uT/pZBHuGjhpM9SvBjY+OcF1cZEA8Q2x5HRlMuutbhZRtziDI69w +HR9EvvRAZoNmaZEVN8XV0YD1SwW0nI/bPkFyElDtJCxwVmssQZqqoua0an4ABXHgSSA zrInR3Q866PpnDS5hV+vKgrFXE96q25TiBcoFQbft61bGB9jeMBLc7BA+GG5g+/mN3Yu A7Sw== X-Gm-Message-State: ALoCoQlUfHY6xin0bmLL19BCx5/Q8poWO/pSzYiL2fnU2EQhYV2ZqGzbHXylBOYBuZ8RBqalAZLo X-Received: by 10.42.194.5 with SMTP id dw5mr8693663icb.5.1393218844275; Sun, 23 Feb 2014 21:14:04 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.43.119 with SMTP id d110ls907274qga.32.gmail; Sun, 23 Feb 2014 21:14:04 -0800 (PST) X-Received: by 10.220.196.82 with SMTP id ef18mr11356305vcb.78.1393218844135; Sun, 23 Feb 2014 21:14:04 -0800 (PST) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id eo4si5545767vdb.69.2014.02.23.21.14.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 23 Feb 2014 21:14:04 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.177 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.177; Received: by mail-vc0-f177.google.com with SMTP id if11so5207838vcb.22 for ; Sun, 23 Feb 2014 21:14:04 -0800 (PST) X-Received: by 10.220.98.204 with SMTP id r12mr11464980vcn.48.1393218843991; Sun, 23 Feb 2014 21:14:03 -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 u4csp36597vcz; Sun, 23 Feb 2014 21:14:03 -0800 (PST) X-Received: by 10.68.133.163 with SMTP id pd3mr22797130pbb.166.1393218843104; Sun, 23 Feb 2014 21:14:03 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k7si15394413pbl.101.2014.02.23.21.14.02; Sun, 23 Feb 2014 21:14:02 -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 S1752571AbaBXFNd (ORCPT + 26 others); Mon, 24 Feb 2014 00:13:33 -0500 Received: from mail-pb0-f45.google.com ([209.85.160.45]:51900 "EHLO mail-pb0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752455AbaBXFN2 (ORCPT ); Mon, 24 Feb 2014 00:13:28 -0500 Received: by mail-pb0-f45.google.com with SMTP id un15so6028554pbc.32 for ; Sun, 23 Feb 2014 21:13:28 -0800 (PST) X-Received: by 10.68.60.225 with SMTP id k1mr6650165pbr.58.1393218808302; Sun, 23 Feb 2014 21:13:28 -0800 (PST) Received: from localhost.localdomain ([162.243.130.63]) by mx.google.com with ESMTPSA id vn10sm45690743pbc.21.2014.02.23.21.13.22 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 23 Feb 2014 21:13:27 -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 07/10] sched: replace source_load by weighted_cpuload Date: Mon, 24 Feb 2014 13:12:22 +0800 Message-Id: <1393218745-8795-8-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1393218745-8795-1-git-send-email-alex.shi@linaro.org> References: <1393218745-8795-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.177 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 d91d925..66fa69b 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); @@ -3939,27 +3938,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) { @@ -4287,7 +4274,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;